@dhtmlx/grid 9.3.3

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 (146) hide show
  1. package/README.md +218 -0
  2. package/codebase/fonts/roboto-bold-webfont.woff +0 -0
  3. package/codebase/fonts/roboto-bold-webfont.woff2 +0 -0
  4. package/codebase/fonts/roboto-medium-webfont.woff +0 -0
  5. package/codebase/fonts/roboto-medium-webfont.woff2 +0 -0
  6. package/codebase/fonts/roboto-regular-webfont.woff +0 -0
  7. package/codebase/fonts/roboto-regular-webfont.woff2 +0 -0
  8. package/codebase/grid.d.ts +3 -0
  9. package/codebase/grid.min.css +1 -0
  10. package/codebase/grid.min.js +21 -0
  11. package/codebase/grid.min.js.map +1 -0
  12. package/codebase/types/ts-calendar/index.d.ts +2 -0
  13. package/codebase/types/ts-calendar/sources/Calendar.d.ts +37 -0
  14. package/codebase/types/ts-calendar/sources/helper.d.ts +1 -0
  15. package/codebase/types/ts-calendar/sources/types.d.ts +64 -0
  16. package/codebase/types/ts-combobox/index.d.ts +3 -0
  17. package/codebase/types/ts-combobox/sources/Combobox.d.ts +53 -0
  18. package/codebase/types/ts-combobox/sources/ProCombobox.d.ts +6 -0
  19. package/codebase/types/ts-combobox/sources/helper.d.ts +4 -0
  20. package/codebase/types/ts-combobox/sources/keyListener.d.ts +14 -0
  21. package/codebase/types/ts-combobox/sources/locales/en.d.ts +8 -0
  22. package/codebase/types/ts-combobox/sources/types.d.ts +95 -0
  23. package/codebase/types/ts-common/CssManager.d.ts +26 -0
  24. package/codebase/types/ts-common/FocusManager.d.ts +15 -0
  25. package/codebase/types/ts-common/KeyManager.d.ts +19 -0
  26. package/codebase/types/ts-common/ScrollView.d.ts +40 -0
  27. package/codebase/types/ts-common/core.d.ts +40 -0
  28. package/codebase/types/ts-common/date.d.ts +34 -0
  29. package/codebase/types/ts-common/dom.d.ts +24 -0
  30. package/codebase/types/ts-common/events.d.ts +35 -0
  31. package/codebase/types/ts-common/html.d.ts +74 -0
  32. package/codebase/types/ts-common/input.d.ts +24 -0
  33. package/codebase/types/ts-common/keycodes.d.ts +9 -0
  34. package/codebase/types/ts-common/locale.d.ts +1 -0
  35. package/codebase/types/ts-common/polyfills/array.d.ts +0 -0
  36. package/codebase/types/ts-common/polyfills/element.d.ts +0 -0
  37. package/codebase/types/ts-common/polyfills/fetch.d.ts +0 -0
  38. package/codebase/types/ts-common/polyfills/math.d.ts +0 -0
  39. package/codebase/types/ts-common/polyfills/object.d.ts +0 -0
  40. package/codebase/types/ts-common/polyfills/string.d.ts +0 -0
  41. package/codebase/types/ts-common/types.d.ts +76 -0
  42. package/codebase/types/ts-common/view.d.ts +27 -0
  43. package/codebase/types/ts-data/index.d.ts +13 -0
  44. package/codebase/types/ts-data/sources/CollectionStore.d.ts +7 -0
  45. package/codebase/types/ts-data/sources/DragManager.d.ts +19 -0
  46. package/codebase/types/ts-data/sources/ajax.d.ts +2 -0
  47. package/codebase/types/ts-data/sources/datacollection/group.d.ts +43 -0
  48. package/codebase/types/ts-data/sources/datacollection/loader.d.ts +16 -0
  49. package/codebase/types/ts-data/sources/datacollection/sort.d.ts +7 -0
  50. package/codebase/types/ts-data/sources/datacollection.d.ts +101 -0
  51. package/codebase/types/ts-data/sources/dataproxy.d.ts +10 -0
  52. package/codebase/types/ts-data/sources/drivers/CsvDriver.d.ts +16 -0
  53. package/codebase/types/ts-data/sources/drivers/JsonDriver.d.ts +10 -0
  54. package/codebase/types/ts-data/sources/drivers/XMLDriver.d.ts +18 -0
  55. package/codebase/types/ts-data/sources/drivers/drivers.d.ts +12 -0
  56. package/codebase/types/ts-data/sources/helpers.d.ts +17 -0
  57. package/codebase/types/ts-data/sources/lazydataproxy.d.ts +9 -0
  58. package/codebase/types/ts-data/sources/methods.d.ts +11 -0
  59. package/codebase/types/ts-data/sources/selection.d.ts +17 -0
  60. package/codebase/types/ts-data/sources/serializers/xml.d.ts +2 -0
  61. package/codebase/types/ts-data/sources/treecollection.d.ts +72 -0
  62. package/codebase/types/ts-data/sources/types.d.ts +340 -0
  63. package/codebase/types/ts-grid/index.d.ts +7 -0
  64. package/codebase/types/ts-grid/sources/ExtendedGrid.d.ts +47 -0
  65. package/codebase/types/ts-grid/sources/Grid.d.ts +114 -0
  66. package/codebase/types/ts-grid/sources/ProGrid.d.ts +67 -0
  67. package/codebase/types/ts-grid/sources/entry.d.ts +7 -0
  68. package/codebase/types/ts-grid/sources/helpers/cells.d.ts +9 -0
  69. package/codebase/types/ts-grid/sources/helpers/data.d.ts +36 -0
  70. package/codebase/types/ts-grid/sources/helpers/default.d.ts +6 -0
  71. package/codebase/types/ts-grid/sources/helpers/dom.d.ts +3 -0
  72. package/codebase/types/ts-grid/sources/helpers/keys.d.ts +27 -0
  73. package/codebase/types/ts-grid/sources/helpers/main.d.ts +23 -0
  74. package/codebase/types/ts-grid/sources/locales/en.d.ts +7 -0
  75. package/codebase/types/ts-grid/sources/modules/BlockSelection.d.ts +122 -0
  76. package/codebase/types/ts-grid/sources/modules/Clipboard.d.ts +55 -0
  77. package/codebase/types/ts-grid/sources/modules/DropManager.d.ts +21 -0
  78. package/codebase/types/ts-grid/sources/modules/Exporter.d.ts +80 -0
  79. package/codebase/types/ts-grid/sources/modules/History.d.ts +72 -0
  80. package/codebase/types/ts-grid/sources/modules/Range.d.ts +71 -0
  81. package/codebase/types/ts-grid/sources/modules/Resizer.d.ts +2 -0
  82. package/codebase/types/ts-grid/sources/modules/Selection.d.ts +58 -0
  83. package/codebase/types/ts-grid/sources/types.d.ts +660 -0
  84. package/codebase/types/ts-grid/sources/ui/FixedCols.d.ts +3 -0
  85. package/codebase/types/ts-grid/sources/ui/FixedRows.d.ts +5 -0
  86. package/codebase/types/ts-grid/sources/ui/cells.d.ts +34 -0
  87. package/codebase/types/ts-grid/sources/ui/common.d.ts +8 -0
  88. package/codebase/types/ts-grid/sources/ui/components/dragPanel.d.ts +7 -0
  89. package/codebase/types/ts-grid/sources/ui/components/groupPanel.d.ts +13 -0
  90. package/codebase/types/ts-grid/sources/ui/components/subRow.d.ts +4 -0
  91. package/codebase/types/ts-grid/sources/ui/content/ComboFilter.d.ts +35 -0
  92. package/codebase/types/ts-grid/sources/ui/content/DateFilter.d.ts +42 -0
  93. package/codebase/types/ts-grid/sources/ui/content/InputFilter.d.ts +32 -0
  94. package/codebase/types/ts-grid/sources/ui/content/SelectFilter.d.ts +28 -0
  95. package/codebase/types/ts-grid/sources/ui/content.d.ts +55 -0
  96. package/codebase/types/ts-grid/sources/ui/editors/CheckboxEditor.d.ts +18 -0
  97. package/codebase/types/ts-grid/sources/ui/editors/ComboboxEditor.d.ts +18 -0
  98. package/codebase/types/ts-grid/sources/ui/editors/DateEditor.d.ts +37 -0
  99. package/codebase/types/ts-grid/sources/ui/editors/InputEditor.d.ts +22 -0
  100. package/codebase/types/ts-grid/sources/ui/editors/SelectEditor.d.ts +16 -0
  101. package/codebase/types/ts-grid/sources/ui/editors/TextAreaEditor.d.ts +27 -0
  102. package/codebase/types/ts-grid/sources/ui/editors/editors.d.ts +2 -0
  103. package/codebase/types/ts-grid/sources/ui/proContent.d.ts +37 -0
  104. package/codebase/types/ts-grid/sources/ui/render.d.ts +9 -0
  105. package/codebase/types/ts-layout/index.d.ts +3 -0
  106. package/codebase/types/ts-layout/sources/Cell.d.ts +60 -0
  107. package/codebase/types/ts-layout/sources/Layout.d.ts +29 -0
  108. package/codebase/types/ts-layout/sources/ProCell.d.ts +9 -0
  109. package/codebase/types/ts-layout/sources/ProLayout.d.ts +6 -0
  110. package/codebase/types/ts-layout/sources/helpers.d.ts +6 -0
  111. package/codebase/types/ts-layout/sources/types.d.ts +129 -0
  112. package/codebase/types/ts-list/index.d.ts +4 -0
  113. package/codebase/types/ts-list/sources/List.d.ts +56 -0
  114. package/codebase/types/ts-list/sources/ProList.d.ts +11 -0
  115. package/codebase/types/ts-list/sources/Selection.d.ts +24 -0
  116. package/codebase/types/ts-list/sources/editors/InputEditor.d.ts +16 -0
  117. package/codebase/types/ts-list/sources/editors/editors.d.ts +4 -0
  118. package/codebase/types/ts-list/sources/types.d.ts +98 -0
  119. package/codebase/types/ts-message/index.d.ts +5 -0
  120. package/codebase/types/ts-message/sources/alert.d.ts +2 -0
  121. package/codebase/types/ts-message/sources/common.d.ts +1 -0
  122. package/codebase/types/ts-message/sources/confirm.d.ts +2 -0
  123. package/codebase/types/ts-message/sources/locales/en.d.ts +5 -0
  124. package/codebase/types/ts-message/sources/message.d.ts +4 -0
  125. package/codebase/types/ts-message/sources/tooltip.d.ts +6 -0
  126. package/codebase/types/ts-message/sources/types.d.ts +79 -0
  127. package/codebase/types/ts-popup/index.d.ts +2 -0
  128. package/codebase/types/ts-popup/sources/Popup.d.ts +29 -0
  129. package/codebase/types/ts-popup/sources/types.d.ts +42 -0
  130. package/codebase/types/ts-slider/index.d.ts +2 -0
  131. package/codebase/types/ts-slider/sources/Slider.d.ts +55 -0
  132. package/codebase/types/ts-slider/sources/types.d.ts +60 -0
  133. package/codebase/types/ts-timepicker/index.d.ts +2 -0
  134. package/codebase/types/ts-timepicker/sources/Timepicker.d.ts +28 -0
  135. package/codebase/types/ts-timepicker/sources/helper.d.ts +4 -0
  136. package/codebase/types/ts-timepicker/sources/locales/en.d.ts +6 -0
  137. package/codebase/types/ts-timepicker/sources/types.d.ts +52 -0
  138. package/codebase/types/ts-treegrid/index.d.ts +3 -0
  139. package/codebase/types/ts-treegrid/sources/TreeGrid.d.ts +26 -0
  140. package/codebase/types/ts-treegrid/sources/TreeGridCollection.d.ts +21 -0
  141. package/codebase/types/ts-treegrid/sources/types.d.ts +17 -0
  142. package/dhtmlx_grid.png +0 -0
  143. package/dhtmlx_logo.svg +4 -0
  144. package/license.md +360 -0
  145. package/package.json +13 -0
  146. package/whatsnew.txt +1407 -0
@@ -0,0 +1,340 @@
1
+ import { IEventSystem } from "../../ts-common/events";
2
+ import { anyFunction, IAnyObj, Id } from "../../ts-common/types";
3
+ import { IGroupConfig, TGroupOrder } from "./datacollection/group";
4
+ import { TDragItem } from "./DragManager";
5
+ export interface IDataProxy {
6
+ url: string;
7
+ config?: any;
8
+ updateUrl?: (url?: string, params?: any) => void;
9
+ load?: () => Promise<any[] | string | void>;
10
+ save?: (data: any, mode: string) => Promise<any>;
11
+ }
12
+ export interface ILazyDataProxy extends IDataProxy {
13
+ config: ILazyConfig;
14
+ }
15
+ export interface ILazyConfig {
16
+ from?: number;
17
+ limit?: number;
18
+ delay?: number;
19
+ prepare?: number;
20
+ }
21
+ export type TSortDir = "asc" | "desc";
22
+ export interface ISortMode {
23
+ by?: string | number;
24
+ dir?: TSortDir;
25
+ as?: (a: any) => any;
26
+ rule?: (a: any, b: any) => number;
27
+ }
28
+ export type ISortingState = ISortMode & ISortConfig;
29
+ export type IFilterCallback = (obj: any) => boolean;
30
+ export interface IFilterMode {
31
+ by?: Id;
32
+ match?: string | number | boolean;
33
+ compare?: (value: any, match: any, obj: any, multi?: boolean) => boolean;
34
+ multi?: any;
35
+ }
36
+ export interface IFilterComplexMode {
37
+ [key: string]: IFilterMode;
38
+ }
39
+ export interface IFilter {
40
+ [key: string]: IFilterParams;
41
+ }
42
+ export interface IFilterParams {
43
+ rule: IFilterMode | IFilterComplexMode | IFilterCallback;
44
+ config: IFilterConfig | ITreeFilterConfig;
45
+ }
46
+ export interface IFilterConfig {
47
+ id?: string;
48
+ add?: boolean;
49
+ smartFilter?: boolean;
50
+ permanent?: boolean;
51
+ $restore?: boolean;
52
+ $local?: boolean;
53
+ }
54
+ export interface IResetFilterConfig {
55
+ id?: string;
56
+ permanent?: boolean;
57
+ }
58
+ export interface ISortConfig {
59
+ smartSorting?: boolean;
60
+ }
61
+ export interface ITreeFilterConfig extends IFilterConfig {
62
+ type?: TreeFilterType;
63
+ level?: number;
64
+ }
65
+ export interface IUpdateObject {
66
+ [key: string]: any;
67
+ }
68
+ export interface IApproximate {
69
+ value: any;
70
+ maxNum: number;
71
+ }
72
+ export interface IDataConfig {
73
+ init?: anyFunction;
74
+ update?: anyFunction;
75
+ approximate?: IApproximate;
76
+ autoload?: string;
77
+ collapsed?: boolean;
78
+ rootId?: Id;
79
+ }
80
+ export interface IGroupDataConfig extends IGroupConfig {
81
+ data?: IDataItem[];
82
+ }
83
+ export interface IDataCollection<T extends IDataItem = IDataItem> {
84
+ config: IDataConfig;
85
+ events: IEventSystem<DataEvents>;
86
+ dataProxy: IDataProxy;
87
+ loadData: Promise<any>;
88
+ saveData: Promise<any>;
89
+ group(order: TGroupOrder[], config?: IGroupDataConfig): void;
90
+ ungroup(): void;
91
+ isGrouped(): boolean;
92
+ load(url: IDataProxy | string, driver?: IDataDriver | DataDriver): Promise<any>;
93
+ parse(data: T[] | string, driver?: DataDriver | IDataDriver): void;
94
+ $parse(data: any[]): void;
95
+ add(newItem: IDataItem, index?: number): Id;
96
+ add(newItem: IDataItem[], index?: number): Id[];
97
+ add(newItem: IDataItem | IDataItem[], index?: number): Id | Id[];
98
+ remove(id: Id | Id[]): void;
99
+ removeAll(): void;
100
+ update(id: Id, newItem: IUpdateObject, silent?: boolean): void;
101
+ exists(id: Id): boolean;
102
+ getInitialData(): T[];
103
+ getItem(id: Id): T;
104
+ getIndex(id: Id): number;
105
+ getLength(): number;
106
+ isDataLoaded(from?: number, to?: number): boolean;
107
+ getId(index: number): Id;
108
+ filter(rule?: IFilterMode | IFilterCallback, config?: IFilterConfig, silent?: boolean): string;
109
+ resetFilter(config?: IResetFilterConfig, silent?: boolean): boolean;
110
+ getFilters(config?: {
111
+ permanent?: boolean;
112
+ }): IFilter;
113
+ getRawFilters(config?: {
114
+ permanent?: boolean;
115
+ }): IFilter;
116
+ find(rule: IFilterMode): T;
117
+ reduce<A>(callback: ReduceCallBack<T, A>, acc: A): A;
118
+ findAll(rule: IFilterMode): T[];
119
+ map(callback: DataCallback<T>): T[];
120
+ mapRange(from: number, to: number, callback: DataCallback<T>): T[];
121
+ sort(rule?: ISortMode, config?: ISortConfig): void;
122
+ getSortingStates(): ISortingState[];
123
+ serialize(driver?: DataDriver): T[];
124
+ copy(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
125
+ move(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
126
+ changeId(id: Id, newId?: Id, silent?: boolean): void;
127
+ forEach(callback: DataCallback<T>): void;
128
+ save(url: IDataProxy | string): void;
129
+ isSaved(): boolean;
130
+ getRawData(from: number, to: number, order?: T[] | null, mode?: number): T[];
131
+ }
132
+ export interface IDataChangeStack {
133
+ order: IDataChange[];
134
+ }
135
+ export type Statuses = "add" | "update" | "remove" | string;
136
+ export interface IDataChange {
137
+ id: Id;
138
+ status: Statuses;
139
+ obj: any;
140
+ saving: boolean;
141
+ promise?: Promise<any>;
142
+ pending?: boolean;
143
+ error?: boolean;
144
+ }
145
+ export type RequestStatus = "saving" | "pending" | "error";
146
+ export interface IDir {
147
+ [key: string]: any;
148
+ asc: number;
149
+ desc: number;
150
+ }
151
+ export interface IDataDriver {
152
+ toJsonArray(data: any): any[];
153
+ serialize(data: IAnyObj[]): any;
154
+ getRows(data: string): any[];
155
+ getFields(row: any): {
156
+ [key: string]: any;
157
+ };
158
+ }
159
+ export interface ICsvDriverConfig {
160
+ skipHeader?: number;
161
+ nameByHeader?: boolean;
162
+ names?: string[];
163
+ rowDelimiter?: string;
164
+ columnDelimiter?: string;
165
+ }
166
+ export declare enum TreeFilterType {
167
+ all = "all",
168
+ level = "level",
169
+ leafs = "leafs"
170
+ }
171
+ export type DataCallback<T> = (item: T, index?: number, array?: T[]) => any;
172
+ export type ReduceCallBack<T, A> = (acc: A, item: T, index?: number) => A;
173
+ export interface ITreeCollection<T extends IDataItem = IDataItem> extends IDataCollection<T> {
174
+ add(newItem: IDataItem, index?: number, parent?: Id): Id;
175
+ add(newItem: IDataItem[], index?: number, parent?: Id): Id[];
176
+ add(newItem: IDataItem | IDataItem[], index?: number, parent?: Id): Id | Id[];
177
+ getRoot(): Id;
178
+ getParent(id: Id): Id;
179
+ removeAll(id?: Id): void;
180
+ getLength(id?: Id): number;
181
+ getIndex(id: Id): number;
182
+ getItems(id: Id): T[];
183
+ sort(rule?: ISortMode, config?: ISortConfig): void;
184
+ map(callback: DataCallback<T>, parent?: Id, direct?: boolean): any;
185
+ filter(rule?: IFilterMode | IFilterCallback, config?: ITreeFilterConfig, silent?: boolean): string;
186
+ restoreOrder(): void;
187
+ copy(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id;
188
+ copy(id: Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id[];
189
+ copy(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
190
+ move(id: Id, index: number, target?: ITreeCollection | IDataCollection, targetId?: Id): Id;
191
+ move(id: Id[], index: number, target?: ITreeCollection | IDataCollection, targetId?: Id): Id[];
192
+ move(id: Id | Id[], index: number, target?: ITreeCollection | IDataCollection, targetId?: Id): Id | Id[];
193
+ eachChild(id: Id, callback: DataCallback<T>, direct?: boolean, checkItem?: (item: IDataItem) => boolean): void;
194
+ eachParent(id: Id, callback: DataCallback<T>, self?: boolean): void;
195
+ loadItems(id: Id, driver?: IDataDriver | DataDriver): void;
196
+ refreshItems(id: Id, driver?: IDataDriver | DataDriver): void;
197
+ haveItems(id: Id): boolean;
198
+ canCopy(id: Id, target: Id): boolean;
199
+ forEach(callback: DataCallback<T>, parent?: Id, level?: number): void;
200
+ }
201
+ export interface IDataItem {
202
+ id?: Id;
203
+ [key: string]: any;
204
+ }
205
+ export type DropPosition = "top" | "bottom" | "in";
206
+ export interface IObjWithData {
207
+ name?: string;
208
+ data: ITreeCollection | IDataCollection;
209
+ events: IEventSystem<DragEvents, IDragEventsHandlersMap>;
210
+ config: IDragConfig;
211
+ id?: Id;
212
+ }
213
+ export interface ITransferData {
214
+ initXOffset?: number;
215
+ initYOffset?: number;
216
+ x?: number;
217
+ y?: number;
218
+ ghost?: HTMLElement;
219
+ componentId?: Id;
220
+ dragConfig?: IDragConfig;
221
+ component?: IObjWithData;
222
+ dropPosition?: DropPosition;
223
+ dropComponentId?: Id;
224
+ item?: HTMLElement;
225
+ start?: Id;
226
+ source?: Id[];
227
+ target?: Id;
228
+ type?: TDragItem;
229
+ isWasColumn?: boolean;
230
+ groupable?: boolean;
231
+ groupOnly?: boolean;
232
+ }
233
+ export interface IDragConfig {
234
+ dragCopy?: boolean;
235
+ dropBehaviour?: DropBehaviour;
236
+ dragMode?: DragMode;
237
+ }
238
+ export interface ICopyObject {
239
+ id: Id;
240
+ component: IObjWithData;
241
+ newId?: Id;
242
+ }
243
+ export declare enum DataEvents {
244
+ afterAdd = "afteradd",
245
+ beforeAdd = "beforeadd",
246
+ removeAll = "removeall",
247
+ beforeRemove = "beforeremove",
248
+ afterRemove = "afterremove",
249
+ change = "change",
250
+ filter = "filter",
251
+ dataRequest = "dataRequest",
252
+ load = "load",
253
+ loadError = "loaderror",
254
+ beforeLazyLoad = "beforelazyload",
255
+ afterLazyLoad = "afterlazyload",
256
+ beforeItemLoad = "beforeItemLoad",
257
+ afterItemLoad = "afterItemLoad",
258
+ beforeGroup = "beforeGroup",
259
+ afterGroup = "afterGroup",
260
+ beforeUnGroup = "beforeUnGroup",
261
+ afterUnGroup = "afterUnGroup"
262
+ }
263
+ export interface IDataEventsHandlersMap {
264
+ [key: string]: (...args: any[]) => any;
265
+ [DataEvents.change]: (id?: Id, status?: Statuses, updatedItem?: IDataItem) => void;
266
+ [DataEvents.filter]: (filter?: IFilter) => void;
267
+ [DataEvents.beforeAdd]: (newItem: IDataItem, batch: IDataItem[], index: number) => boolean | void;
268
+ [DataEvents.afterAdd]: (newItem: IDataItem, batch: IDataItem[], index: number) => void;
269
+ [DataEvents.beforeRemove]: (removedItem: IDataItem, batch: IDataItem[], index: number) => boolean | void;
270
+ [DataEvents.afterRemove]: (removedItem: IDataItem, batch: IDataItem[], index: number) => void;
271
+ [DataEvents.removeAll]: () => void;
272
+ [DataEvents.dataRequest]: (from: number, to: number) => void;
273
+ [DataEvents.load]: () => void;
274
+ [DataEvents.loadError]: (response: any) => void;
275
+ [DataEvents.beforeItemLoad]: (id: Id) => boolean | void;
276
+ [DataEvents.afterItemLoad]: (id: Id) => void;
277
+ [DataEvents.beforeLazyLoad]: () => boolean | void;
278
+ [DataEvents.afterLazyLoad]: (from: number, count: number) => void;
279
+ [DataEvents.beforeGroup]: (config: IGroupConfig) => boolean | void;
280
+ [DataEvents.afterGroup]: (grouped: string[], config: IGroupConfig) => void;
281
+ [DataEvents.beforeUnGroup]: (grouped: string[], config: IGroupConfig) => boolean | void;
282
+ [DataEvents.afterUnGroup]: (grouped: string[], config: IGroupConfig) => void;
283
+ }
284
+ export declare enum DragEvents {
285
+ beforeDrag = "beforeDrag",
286
+ dragStart = "dragStart",
287
+ dragOut = "dragOut",
288
+ dragIn = "dragIn",
289
+ canDrop = "canDrop",
290
+ cancelDrop = "cancelDrop",
291
+ beforeDrop = "beforeDrop",
292
+ afterDrop = "afterDrop",
293
+ afterDrag = "afterDrag"
294
+ }
295
+ export interface IDragInfo {
296
+ start: Id;
297
+ source: Id[];
298
+ target: Id;
299
+ dropPosition?: DropPosition;
300
+ }
301
+ export type DragMode = "target" | "both" | "source";
302
+ export type DropBehaviour = "child" | "sibling" | "complex";
303
+ export interface IDragEventsHandlersMap {
304
+ [key: string]: (...args: any[]) => any;
305
+ [DragEvents.beforeDrag]: (data: IDragInfo, events: MouseEvent, ghost: HTMLElement, type: TDragItem) => void | boolean;
306
+ [DragEvents.dragStart]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
307
+ [DragEvents.dragOut]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
308
+ [DragEvents.dragIn]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void | boolean;
309
+ [DragEvents.canDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
310
+ [DragEvents.cancelDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void;
311
+ [DragEvents.beforeDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => void | boolean;
312
+ [DragEvents.afterDrop]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => any;
313
+ [DragEvents.afterDrag]: (data: IDragInfo, events: MouseEvent, type: TDragItem) => any;
314
+ }
315
+ export declare enum DataDriver {
316
+ json = "json",
317
+ csv = "csv",
318
+ xml = "xml"
319
+ }
320
+ export type AjaxResponseType = "json" | "xml" | "text" | "raw";
321
+ export interface IAjaxHelperConfig {
322
+ headers: {
323
+ [key: string]: string;
324
+ };
325
+ responseType: AjaxResponseType;
326
+ }
327
+ export interface IAjaxHelper {
328
+ get<T>(url: string, data?: {
329
+ [key: string]: any;
330
+ } | string, config?: Partial<IAjaxHelperConfig>): Promise<T | void>;
331
+ post<T>(url: string, data?: {
332
+ [key: string]: any;
333
+ } | string, config?: Partial<IAjaxHelperConfig>): Promise<T | void>;
334
+ put<T>(url: string, data?: {
335
+ [key: string]: any;
336
+ } | string, config?: Partial<IAjaxHelperConfig>): Promise<T | void>;
337
+ delete<T>(url: string, data?: {
338
+ [key: string]: any;
339
+ } | string, config?: Partial<IAjaxHelperConfig>): Promise<T | void>;
340
+ }
@@ -0,0 +1,7 @@
1
+ export * from "./sources/Grid";
2
+ export * from "./sources/ExtendedGrid";
3
+ export * from "./sources/ProGrid";
4
+ export * from "./sources/types";
5
+ export * from "./sources/helpers/cells";
6
+ export * from "./sources/helpers/data";
7
+ export * from "./sources/helpers/main";
@@ -0,0 +1,47 @@
1
+ import { IGridConfig, ICol, IRow, IFooter, IHeader, IGroupOrderItem, IExtendedGrid, IExtendedGridConfig, ISubViewCell } from "./types";
2
+ import { IDataCollection, IDataItem } from "../../ts-data";
3
+ import { ScrollView } from "../../ts-common/ScrollView";
4
+ import { Id } from "../../ts-common/types";
5
+ import { Grid } from "./Grid";
6
+ import { IRange } from "./modules/Range";
7
+ import { IBlockSelection } from "./modules/BlockSelection";
8
+ import { IClipboard } from "./modules/Clipboard";
9
+ import { IHistory } from "./modules/History";
10
+ import { IProContentList } from "./ui/proContent";
11
+ export declare class ExtendedGrid extends Grid implements IExtendedGrid {
12
+ range: IRange;
13
+ block: IBlockSelection;
14
+ clipboard: IClipboard;
15
+ history: IHistory;
16
+ scrollView: ScrollView;
17
+ config: IExtendedGridConfig;
18
+ content: IProContentList;
19
+ constructor(container: HTMLElement | string | null, config?: IExtendedGridConfig);
20
+ expand(rowId: Id): void;
21
+ collapse(rowId: Id): void;
22
+ expandAll(): void;
23
+ collapseAll(): void;
24
+ getSubRow(id: Id): ISubViewCell | null;
25
+ destructor(): void;
26
+ protected _createView(): any;
27
+ protected _init(): void;
28
+ protected _dragInit(): void;
29
+ protected _setHTMLEventHandlers(): void;
30
+ protected _setEventHandlers(): void;
31
+ protected _afterEditEndProcess(value: any, editableRow: any, editableColumn: any): void;
32
+ protected _setSort(): void;
33
+ protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
34
+ protected _prepareData(data: IDataItem[] | IDataCollection): IRow[] | IDataItem[];
35
+ protected _prepareDataFromTo(data: IDataCollection, from: number, to: number): IDataItem[];
36
+ protected _dragStart(event: any): void;
37
+ protected _group(order: IGroupOrderItem[]): void;
38
+ protected _expand(row: IRow): boolean;
39
+ protected _collapse(row: IRow): boolean;
40
+ private _lazyLoad;
41
+ private _getGhostItem;
42
+ private _dragStartColumn;
43
+ private _dragStartGroupItem;
44
+ private _changeGroupItemAfterSort;
45
+ private _isGroupableColumn;
46
+ private _isGroupClosable;
47
+ }
@@ -0,0 +1,114 @@
1
+ import { IEventSystem } from "../../ts-common/events";
2
+ import { IKeyManager } from "../../ts-common/KeyManager";
3
+ import { Id, ITouchParam } from "../../ts-common/types";
4
+ import { View } from "../../ts-common/view";
5
+ import { DataEvents, DragEvents, IDataCollection, IDataEventsHandlersMap, IDataItem, IDragEventsHandlersMap, TSortDir } from "../../ts-data";
6
+ import { Exporter } from "./modules/Exporter";
7
+ import { ISelection } from "./modules/Selection";
8
+ import { EditorType, GridEvents, IAdjustBy, ICellRect, ICol, ICoords, IEventHandlersMap, IGrid, IGridConfig, IRow, IScrollState, ISpan, GridSystemEvents, ISystemEventHandlersMap, IColumnsWidth, SortFunction, IAdjustColumns, IDirection, IFooter, IHeader, INormalizeColumnsParams, ISummaryList, ISortingStates } from "./types";
9
+ import { IContentList, IHeaderFilter } from "./ui/content";
10
+ import { IProContentList } from "./ui/proContent";
11
+ export declare class Grid extends View implements IGrid {
12
+ version: string;
13
+ name: "grid";
14
+ data: IDataCollection;
15
+ config: IGridConfig;
16
+ events: IEventSystem<DataEvents | GridEvents | DragEvents, IEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap>;
17
+ export: Exporter;
18
+ content: IContentList | IProContentList;
19
+ selection: ISelection;
20
+ keyManager: IKeyManager;
21
+ protected _touch: ITouchParam;
22
+ protected _destructed: boolean;
23
+ protected _scroll: IScrollState;
24
+ protected _events: IEventSystem<GridSystemEvents, ISystemEventHandlersMap>;
25
+ protected _htmlEvents: any;
26
+ protected _sortingStates: ISortingStates;
27
+ protected _activeFilters: object;
28
+ protected _dropManager: any;
29
+ private _filterData;
30
+ private _hiddenFilters;
31
+ private _commonSummary;
32
+ private _colSummary;
33
+ constructor(container: HTMLElement | string | null, config?: IGridConfig);
34
+ destructor(): void;
35
+ setColumns(columns: ICol[]): void;
36
+ addRowCss(rowId: Id, css: string): void;
37
+ removeRowCss(rowId: Id, css: string): void;
38
+ addCellCss(rowId: Id, colId: Id, css: string): void;
39
+ removeCellCss(rowId: Id, colId: Id, css: string): void;
40
+ showColumn(colId: Id): void;
41
+ hideColumn(colId: Id): void;
42
+ isColumnHidden(colId: Id): boolean;
43
+ showRow(rowId: Id): void;
44
+ hideRow(rowId: Id): void;
45
+ isRowHidden(rowId: Id): boolean;
46
+ getScrollState(): ICoords;
47
+ scroll(x: number, y: number): void;
48
+ scrollTo(rowId: Id, colId: Id): void;
49
+ adjustColumnWidth(colId: Id, adjust?: IAdjustBy): void;
50
+ getCellRect(rowId: Id, colId?: Id): ICellRect;
51
+ getColumn(colId: Id): ICol;
52
+ addSpan(spanObj: ISpan): void;
53
+ getSpan(rowId: Id, colId: Id): ISpan;
54
+ removeSpan(rowId: Id, colId: Id): void;
55
+ editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
56
+ editEnd(withoutSave?: boolean): void;
57
+ getHeaderFilter(colId: Id): IHeaderFilter;
58
+ getSummary(colId?: Id): ISummaryList;
59
+ /** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
60
+ getSortingState(): {
61
+ dir?: TSortDir;
62
+ by?: Id;
63
+ };
64
+ protected _createView(): any;
65
+ protected _dragInit(): void;
66
+ protected _parseColumns(configChanged?: boolean): void;
67
+ protected normalizeColumns({ config, columns, configChanged }: INormalizeColumnsParams): void;
68
+ protected getNormalizeContentHeight(row: IFooter | IHeader, col: ICol, config: IGridConfig): number;
69
+ protected _parseData(): void;
70
+ protected _createCollection(): void;
71
+ protected _getRowIndex(rowId: Id): number;
72
+ protected _setHTMLEventHandlers(): void;
73
+ protected _setEventHandlers(): void;
74
+ protected _afterEditEndProcess(value: any, editableRow: any, editableColumn: any): void;
75
+ protected _addEmptyRow(): void;
76
+ protected _sort(by: Id, sortAs?: SortFunction, smartSorting?: boolean): void;
77
+ protected _setSort(): void;
78
+ protected _clearTouchTimer(): void;
79
+ protected _checkFilters(reset?: boolean): void;
80
+ protected _setUniqueData(sync?: boolean): void;
81
+ protected _checkSelectFilterValue(): void;
82
+ protected _clearFilterValue(allCols?: boolean): void;
83
+ protected _adjustColumns(): void;
84
+ protected _prepareData(data: IDataItem[] | IDataCollection): any[] | IDataItem[];
85
+ protected _adjustColumnsWidth({ rows, cols, adjust, }: IAdjustColumns): IColumnsWidth;
86
+ protected _prepareColumnData(data: any, type: "header" | "footer"): IRow[];
87
+ protected _dragStart(event: any): void;
88
+ protected _dragProcess(event: MouseEvent | TouchEvent, row: IRow, column?: ICol): void;
89
+ protected _getRowGhost(ids: Id[]): HTMLDivElement;
90
+ protected _initHooks(): {
91
+ didMount: () => void;
92
+ };
93
+ protected _normalizeDataType(): void;
94
+ protected _applyLocalFilter(beforePrepareData?: boolean): void;
95
+ protected _normalizeSpans(): void;
96
+ protected _hideColumn(column: ICol): void;
97
+ protected _showColumn(column: ICol): void;
98
+ protected _setSummary(): void;
99
+ protected _init(): void;
100
+ private _applyMethod;
101
+ private _canDataParse;
102
+ private _attachDataCollection;
103
+ private _setMarks;
104
+ private _checkMarks;
105
+ private _removeMarks;
106
+ private _detectColsTypes;
107
+ private _destroyContent;
108
+ private _render;
109
+ private _initHotKey;
110
+ private _normalizeConfig;
111
+ protected _autoScroll(mode: IDirection): void;
112
+ private _applyAutoWidth;
113
+ private _handleRow;
114
+ }
@@ -0,0 +1,67 @@
1
+ import { ScrollView } from "../../ts-common/ScrollView";
2
+ import { TreeGridCollection } from "../../ts-treegrid";
3
+ import { EditorType, GridEvents, IAdjustBy, ICellRect, ICol, ICoords, IEventHandlersMap, IProGrid, IProGridConfig, ISpan, ISubViewCell, ISummaryList } from "./types";
4
+ import { IKeyManager } from "../../ts-common/KeyManager";
5
+ import { IEventSystem } from "../../ts-common/events";
6
+ import { Id } from "../../ts-common/types";
7
+ import { DataEvents, DragEvents, IDataEventsHandlersMap, IDragEventsHandlersMap, IDataCollection, IDataItem, TSortDir } from "../../ts-data";
8
+ import { ISelection } from "./modules/Selection";
9
+ import { IRange } from "./modules/Range";
10
+ import { IBlockSelection } from "./modules/BlockSelection";
11
+ import { IClipboard } from "./modules/Clipboard";
12
+ import { IHistory } from "./modules/History";
13
+ import { IProContentList, IProHeaderFilter } from "./ui/proContent";
14
+ export declare class ProGrid implements IProGrid {
15
+ config: IProGridConfig;
16
+ scrollView: ScrollView;
17
+ events: IEventSystem<GridEvents | DataEvents | DragEvents, IEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap>;
18
+ name: string;
19
+ data: IDataCollection<IDataItem> & TreeGridCollection;
20
+ selection: ISelection;
21
+ content: IProContentList;
22
+ keyManager: IKeyManager;
23
+ export: any;
24
+ range: IRange;
25
+ block: IBlockSelection;
26
+ clipboard: IClipboard;
27
+ history: IHistory;
28
+ constructor(container: HTMLElement | string | null, config?: IProGridConfig);
29
+ paint(): void;
30
+ destructor(): void;
31
+ expand(rowId: Id): void;
32
+ collapse(rowId: Id): void;
33
+ expandAll(): void;
34
+ collapseAll(): void;
35
+ showColumn(colId: Id): void;
36
+ hideColumn(colId: Id): void;
37
+ isColumnHidden(colId: Id): boolean;
38
+ showRow(rowId: Id): void;
39
+ hideRow(rowId: Id): void;
40
+ isRowHidden(rowId: Id): boolean;
41
+ scrollTo(rowId: Id, colId: Id): void;
42
+ scroll(x?: number, y?: number): void;
43
+ getScrollState(): ICoords;
44
+ setColumns(col: ICol[]): void;
45
+ addRowCss(rowId: Id, css: string): void;
46
+ removeRowCss(rowId: Id, css: string): void;
47
+ addCellCss(rowId: Id, colId: Id, css: string): void;
48
+ removeCellCss(rowId: Id, colId: Id, css: string): void;
49
+ adjustColumnWidth(colId: Id, adjust?: IAdjustBy): void;
50
+ getCellRect(rowId: Id, colId: Id): ICellRect;
51
+ getColumn(colId: Id): ICol;
52
+ addSpan(spanObj: ISpan): void;
53
+ getSpan(rowId: Id, colId: Id): ISpan;
54
+ removeSpan(rowId: Id, colId: Id): void;
55
+ editCell(rowId: Id, colId: Id, editorType?: EditorType): void;
56
+ editEnd(withoutSave?: boolean): void;
57
+ getHeaderFilter(colId: Id): IProHeaderFilter;
58
+ getSummary(colId?: Id): ISummaryList;
59
+ getSubRow(id: Id): ISubViewCell | null;
60
+ getRootNode(): HTMLElement;
61
+ getRootView(): void;
62
+ /** @deprecated See a documentation: https://docs.dhtmlx.com/suite/migration/ */
63
+ getSortingState(): {
64
+ dir?: TSortDir;
65
+ by?: Id;
66
+ };
67
+ }
@@ -0,0 +1,7 @@
1
+ import "../../styles/grid.scss";
2
+ import "../../styles/themes.scss";
3
+ export { cssManager } from "../../ts-common/CssManager";
4
+ export { awaitRedraw, setTheme } from "../../ts-common/dom";
5
+ export { DataCollection, DataProxy, methods } from "../../ts-data";
6
+ export { Grid } from "./Grid";
7
+ export declare const i18n: any;
@@ -0,0 +1,9 @@
1
+ import { ICell, ICol, IGrid, IRow, ISpan } from "./../types";
2
+ import { Id } from "../../../ts-common/types";
3
+ export declare function getWidth(columns: ICol[], colspan: number, index: number): number;
4
+ export declare function getSpanHeight(rows: IRow[], span: ISpan): number;
5
+ export declare function getReducedColspan(columns: ICol[], colId: Id, colspan: number): number;
6
+ export declare function getReducedRowspan(initialRows: IRow[], currRows: IRow[], rowIndex: number, span: ISpan): number;
7
+ export declare function normalizeCell(cell: ICell, grid: IGrid): ICell;
8
+ export declare function clearCells(grid: any, cells: ICell[]): void;
9
+ export declare function formatValue(value: string, cell: ICell): any;
@@ -0,0 +1,36 @@
1
+ import { IContainerConfig } from "../../../ts-common/core";
2
+ import { ICol, IColumnsWidth, IGridConfig, IRow, AdjustTargetType, TOption, IScrollState, IVisibleRange, ISizes } from "./../types";
3
+ import { Id } from "../../../ts-common/types";
4
+ export declare function getTotalRowHeight(row: IRow): number;
5
+ export declare function normalizeArray(obj: any, name: string): void;
6
+ export declare function measureTextHeight({ text, width, lineHeight, font, htmlEnable, }: {
7
+ text?: string;
8
+ width?: number;
9
+ lineHeight?: number;
10
+ font?: string;
11
+ htmlEnable?: boolean;
12
+ }): number;
13
+ export declare function countColumns(config: IGridConfig, columns: ICol[]): number;
14
+ export declare function calculateVisibleRange(viewPortSize: ISizes, scroll: IScrollState, config: IGridConfig, data: IRow[]): IVisibleRange;
15
+ export declare function getNormalizeFilterData(arr: any[], name: Id, multiselection: boolean, editorType: ICol["editorType"]): any[];
16
+ export declare const getMaxRowHeight: ({ cols, row, config, }: {
17
+ row: IRow;
18
+ cols: ICol[];
19
+ config?: IContainerConfig;
20
+ }) => number;
21
+ export declare const getCalculatedRowHeight: (height: number, config?: {
22
+ rowHeight: number;
23
+ verticalOffset?: number;
24
+ }) => number;
25
+ export declare const getTreeCellWidthOffset: (row: IRow, toArrow?: boolean) => number;
26
+ export declare const getMaxColsWidth: (rows: IRow[], cols: ICol[], config: IContainerConfig, target: AdjustTargetType) => IColumnsWidth;
27
+ export declare function applyPattern(value: string | number | boolean, col: ICol): string | number | boolean;
28
+ export declare function getEditorOptions(col: ICol, row?: IRow): TOption[];
29
+ export declare function getOptionValue(value: string, column: ICol): string;
30
+ export declare function getValueForNumberColumn(col: ICol, value: any): any;
31
+ export declare function getComboEditorValue(value: any, col: ICol, row: IRow): any;
32
+ export declare function getEditorValue(value: any, options: TOption[]): any;
33
+ export declare function getReverseScrollState(grid: any): {
34
+ x: number;
35
+ y: number;
36
+ };
@@ -0,0 +1,6 @@
1
+ import { IHistoryConfig } from "../modules/History";
2
+ import { IDragPanelConfig, IGroup, ISubRowConfig } from "../types";
3
+ export declare const getGroupDefaultConfig: (config?: IGroup | boolean) => IGroup;
4
+ export declare const defaultSubRowConfig: Omit<ISubRowConfig, "view">;
5
+ export declare const defaultDragPanelConfig: IDragPanelConfig;
6
+ export declare const defaultHistoryConfig: IHistoryConfig;
@@ -0,0 +1,3 @@
1
+ import { Id } from "../../../ts-common/types";
2
+ export declare function getRowNode(id: Id, root: HTMLElement, split?: "left" | "right"): HTMLElement;
3
+ export declare function getVisibleRowNode(row: HTMLElement, width: number, offset: number): HTMLElement;
@@ -0,0 +1,27 @@
1
+ export declare function getKeysHandlers(grid: any): {
2
+ enter: () => void;
3
+ space: (e: any) => void;
4
+ escape: () => void;
5
+ tab: (e: any) => void;
6
+ delete: () => void;
7
+ "shift+tab": (e: any) => void;
8
+ arrowUp: (event: any) => void;
9
+ "ctrl+z": () => void;
10
+ "ctrl+shift+z": () => void;
11
+ "ctrl+enter": () => void;
12
+ "ctrl+arrowUp": (event: any) => void;
13
+ "shift+arrowUp": (event: any) => void;
14
+ "ctrl+shift+arrowUp": (event: any) => void;
15
+ arrowDown: (event: any) => void;
16
+ "ctrl+arrowDown": (event: any) => void;
17
+ "shift+arrowDown": (event: any) => void;
18
+ "ctrl+shift+arrowDown": (event: any) => void;
19
+ arrowRight: (event: any) => void;
20
+ "ctrl+arrowRight": (event: any) => void;
21
+ "shift+arrowRight": (event: any) => void;
22
+ "ctrl+shift+arrowRight": (event: any) => void;
23
+ arrowLeft: (event: any) => void;
24
+ "ctrl+arrowLeft": (event: any) => void;
25
+ "shift+arrowLeft": (event: any) => void;
26
+ "ctrl+shift+arrowLeft": (event: any) => void;
27
+ };