@slickgrid-universal/composite-editor-component 2.5.0 → 2.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/dist/commonjs/compositeEditor.factory.js +237 -237
- package/dist/commonjs/index.js +18 -18
- package/dist/commonjs/slick-composite-editor.component.js +890 -890
- package/dist/esm/compositeEditor.factory.js +233 -233
- package/dist/esm/index.js +2 -2
- package/dist/esm/slick-composite-editor.component.js +886 -886
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/{commonjs → types}/compositeEditor.factory.d.ts +35 -34
- package/dist/types/compositeEditor.factory.d.ts.map +1 -0
- package/dist/{esm → types}/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -0
- package/dist/{esm → types}/slick-composite-editor.component.d.ts +178 -177
- package/dist/types/slick-composite-editor.component.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/commonjs/index.d.ts +0 -2
- package/dist/commonjs/slick-composite-editor.component.d.ts +0 -177
- package/dist/esm/compositeEditor.factory.d.ts +0 -34
|
@@ -1,177 +1,178 @@
|
|
|
1
|
-
import { BindingEventService, Column, CompositeEditorLabel, CompositeEditorOpenDetailOption, CompositeEditorOption, ContainerService, DOMEvent, Editor, EditorValidationResult, ExternalResource, GridOption, GridService, Locale, OnErrorOption, OnCompositeEditorChangeEventArgs, PlainFunc, SlickDataView, SlickEventHandler, SlickGrid, TranslaterService } from '@slickgrid-universal/common';
|
|
2
|
-
type ApplyChangesCallbackFn = (formValues: {
|
|
3
|
-
[columnId: string]: any;
|
|
4
|
-
} | null, selection: {
|
|
5
|
-
gridRowIndexes: number[];
|
|
6
|
-
dataContextIds: Array<number | string>;
|
|
7
|
-
}, applyToDataview?: boolean) => any[] | void | undefined;
|
|
8
|
-
type DataSelection = {
|
|
9
|
-
gridRowIndexes: number[];
|
|
10
|
-
dataContextIds: Array<number | string>;
|
|
11
|
-
};
|
|
12
|
-
export declare class SlickCompositeEditorComponent implements ExternalResource {
|
|
13
|
-
protected _bindEventService: BindingEventService;
|
|
14
|
-
protected _columnDefinitions: Column[];
|
|
15
|
-
protected _compositeOptions: CompositeEditorOption;
|
|
16
|
-
protected _eventHandler: SlickEventHandler;
|
|
17
|
-
protected _itemDataContext: any;
|
|
18
|
-
protected _modalElm: HTMLDivElement;
|
|
19
|
-
protected _originalDataContext: any;
|
|
20
|
-
protected _options: CompositeEditorOpenDetailOption;
|
|
21
|
-
protected _lastActiveRowNumber: number;
|
|
22
|
-
protected _locales: Locale;
|
|
23
|
-
protected _formValues: {
|
|
24
|
-
[columnId: string]: any;
|
|
25
|
-
} | null;
|
|
26
|
-
protected _editors: {
|
|
27
|
-
[columnId: string]: Editor;
|
|
28
|
-
};
|
|
29
|
-
protected _editorContainers: Array<HTMLElement | null>;
|
|
30
|
-
protected _modalBodyTopValidationElm: HTMLDivElement;
|
|
31
|
-
protected _modalSaveButtonElm: HTMLButtonElement;
|
|
32
|
-
protected grid: SlickGrid;
|
|
33
|
-
protected gridService: GridService | null;
|
|
34
|
-
protected translaterService?: TranslaterService | null;
|
|
35
|
-
get eventHandler(): SlickEventHandler;
|
|
36
|
-
get dataView(): SlickDataView;
|
|
37
|
-
get dataViewLength(): number;
|
|
38
|
-
get formValues(): any;
|
|
39
|
-
get editors(): {
|
|
40
|
-
[columnId: string]: Editor;
|
|
41
|
-
};
|
|
42
|
-
set editors(editors: {
|
|
43
|
-
[columnId: string]: Editor;
|
|
44
|
-
});
|
|
45
|
-
get gridOptions(): GridOption;
|
|
46
|
-
constructor();
|
|
47
|
-
/**
|
|
48
|
-
* initialize the Composite Editor by passing the SlickGrid object and the container service
|
|
49
|
-
*
|
|
50
|
-
* Note: we aren't using DI in the constructor simply to be as framework agnostic as possible,
|
|
51
|
-
* we are simply using this init() function with a very basic container service to do the job
|
|
52
|
-
*/
|
|
53
|
-
init(grid: SlickGrid, containerService: ContainerService): void;
|
|
54
|
-
/** Dispose of the Component & unsubscribe all events */
|
|
55
|
-
dispose(): void;
|
|
56
|
-
/** Dispose of the Component without unsubscribing any events */
|
|
57
|
-
disposeComponent(): void;
|
|
58
|
-
/**
|
|
59
|
-
* Dynamically change value of an input from the Composite Editor form.
|
|
60
|
-
*
|
|
61
|
-
* NOTE: user might get an error thrown when trying to apply a value on a Composite Editor that was not found in the form,
|
|
62
|
-
* but in some cases the user might still want the value to be applied to the formValues so that it will be sent to the save in final item data context
|
|
63
|
-
* and when that happens, you can just skip that error so it won't throw.
|
|
64
|
-
* @param {String | Column} columnIdOrDef - column id or column definition
|
|
65
|
-
* @param {*} newValue - the new value
|
|
66
|
-
* @param {Boolean} skipMissingEditorError - defaults to False, skipping the error when the Composite Editor was not found will allow to still apply the value into the formValues object
|
|
67
|
-
* @param {Boolean} triggerOnCompositeEditorChange - defaults to True, will this change trigger a onCompositeEditorChange event?
|
|
68
|
-
*/
|
|
69
|
-
changeFormInputValue(columnIdOrDef: string | Column, newValue: any, skipMissingEditorError?: boolean, triggerOnCompositeEditorChange?: boolean): void;
|
|
70
|
-
/**
|
|
71
|
-
* Dynamically update the `formValues` object directly without triggering the onCompositeEditorChange event.
|
|
72
|
-
* The fact that this doesn't trigger an event, might not always be good though, in these cases you are probably better with using the changeFormInputValue() method
|
|
73
|
-
* @param {String | Column} columnIdOrDef - column id or column definition
|
|
74
|
-
* @param {*} newValue - the new value
|
|
75
|
-
*/
|
|
76
|
-
changeFormValue(columnIdOrDef: string | Column, newValue: any): void;
|
|
77
|
-
/**
|
|
78
|
-
* Dynamically change an Editor option of the Composite Editor form
|
|
79
|
-
* For example, a use case could be to dynamically change the "minDate" of another Date Editor in the Composite Editor form.
|
|
80
|
-
* @param {String} columnId - column id
|
|
81
|
-
* @param {*} newValue - the new value
|
|
82
|
-
*/
|
|
83
|
-
changeFormEditorOption(columnId: string, optionName: string, newOptionValue: any): void;
|
|
84
|
-
/**
|
|
85
|
-
* Disable (or enable) an input of the Composite Editor form
|
|
86
|
-
* @param {String} columnId - column definition id
|
|
87
|
-
* @param isDisabled - defaults to True, are we disabling the associated form input
|
|
88
|
-
*/
|
|
89
|
-
disableFormInput(columnId: string, isDisabled?: boolean): void;
|
|
90
|
-
/** Entry point to initialize and open the Composite Editor modal window */
|
|
91
|
-
openDetails(options: CompositeEditorOpenDetailOption): SlickCompositeEditorComponent | null;
|
|
92
|
-
/** Cancel the Editing which will also close the modal window */
|
|
93
|
-
cancelEditing(): Promise<void>;
|
|
94
|
-
/** Show a Validation Summary text (as a <div>) when a validation fails or simply hide it when there's no error */
|
|
95
|
-
showValidationSummaryText(isShowing: boolean, errorMsg?: string): void;
|
|
96
|
-
/** Apply Mass Update Changes (form values) to the entire dataset */
|
|
97
|
-
protected applySaveMassUpdateChanges(formValues: any, _selection: DataSelection, applyToDataview?: boolean): any[];
|
|
98
|
-
/** Apply Mass Changes to the Selected rows in the grid (form values) */
|
|
99
|
-
protected applySaveMassSelectionChanges(formValues: any, selection: DataSelection, applyToDataview?: boolean): any[];
|
|
100
|
-
/**
|
|
101
|
-
* Auto-Calculate how many columns to display in the view layout (1, 2, or 3).
|
|
102
|
-
* We'll display a 1 column layout for 8 or less Editors, 2 columns layout for less than 15 Editors or 3 columns when more than 15 Editors
|
|
103
|
-
* @param {number} editorCount - how many Editors do we have in total
|
|
104
|
-
* @returns {number} count - calculated column count (1, 2 or 3)
|
|
105
|
-
*/
|
|
106
|
-
protected autoCalculateLayoutColumnCount(editorCount: number): number;
|
|
107
|
-
/**
|
|
108
|
-
* Create a reset button for each editor and attach a button click handler
|
|
109
|
-
* @param {String} columnId - column id
|
|
110
|
-
* @returns {Object} - html button
|
|
111
|
-
*/
|
|
112
|
-
protected createEditorResetButtonElement(columnId: string): HTMLButtonElement;
|
|
113
|
-
/**
|
|
114
|
-
* Create a form reset button and attach a button click handler
|
|
115
|
-
* @param {String} columnId - column id
|
|
116
|
-
* @returns {Object} - html button
|
|
117
|
-
*/
|
|
118
|
-
protected createFormResetButtonElement(): HTMLDivElement;
|
|
119
|
-
/**
|
|
120
|
-
* Execute the onError callback when defined
|
|
121
|
-
* or use the default onError callback which is to simply display the error in the console
|
|
122
|
-
*/
|
|
123
|
-
protected executeOnError(error: OnErrorOption): void;
|
|
124
|
-
/**
|
|
125
|
-
* A simple and generic method to execute the "OnSave" callback if it's defined by the user OR else simply execute built-in apply changes callback.
|
|
126
|
-
* This method deals with multiple callbacks as shown below
|
|
127
|
-
* @param {Function} applyChangesCallback - first callback to apply the changes into the grid (this could be a user custom callback)
|
|
128
|
-
* @param {Function} executePostCallback - second callback to execute right after the "onSave"
|
|
129
|
-
* @param {Function} beforeClosingCallback - third and last callback to execute after Saving but just before closing the modal window
|
|
130
|
-
* @param {Object} itemDataContext - item data context when modal type is (create/clone/edit)
|
|
131
|
-
*/
|
|
132
|
-
protected executeOnSave(applyChangesCallback: ApplyChangesCallbackFn, executePostCallback: PlainFunc, beforeClosingCallback?: PlainFunc, itemDataContext?: any): Promise<void>;
|
|
133
|
-
protected focusOnFirstColumnCellWithEditor(columns: Column[], dataContext: any, columnIndex: number, rowIndex: number, isWithMassChange: boolean): boolean;
|
|
134
|
-
protected findNextAvailableEditorColumnIndex(columns: Column[], dataContext: any, rowIndex: number, isWithMassUpdate: boolean): number;
|
|
135
|
-
/**
|
|
136
|
-
* Get a column definition by providing a column id OR a column definition.
|
|
137
|
-
* If the input is a string, we'll assume it's a columnId and we'll simply search for the column in the column definitions list
|
|
138
|
-
*/
|
|
139
|
-
protected getColumnByObjectOrId(columnIdOrDef: string | Column): Column | undefined;
|
|
140
|
-
protected getActiveCellEditor(row: number, cell: number): Editor | null;
|
|
141
|
-
/**
|
|
142
|
-
* Get the column label, the label might have an optional "columnGroup" (or "columnGroupKey" which need to be translated)
|
|
143
|
-
* @param {object} columnDef - column definition
|
|
144
|
-
* @returns {string} label - column label
|
|
145
|
-
*/
|
|
146
|
-
protected getColumnLabel(columnDef: Column): string;
|
|
147
|
-
/** Get the correct label text depending, if we use a Translater Service then translate the text when possible else use default text */
|
|
148
|
-
protected getLabelText(labelProperty: keyof CompositeEditorLabel, localeText: string, defaultText: string): string;
|
|
149
|
-
/** Retrieve the current selection of row indexes & data context Ids */
|
|
150
|
-
protected getCurrentRowSelections(): {
|
|
151
|
-
gridRowIndexes: number[];
|
|
152
|
-
dataContextIds: Array<string | number>;
|
|
153
|
-
};
|
|
154
|
-
protected handleBodyClicked(event: Event): void;
|
|
155
|
-
protected handleKeyDown(event: KeyboardEvent): void;
|
|
156
|
-
protected handleResetInputValue(event: DOMEvent<HTMLButtonElement>): void;
|
|
157
|
-
/** Callback which processes a Mass Update or Mass Selection Changes */
|
|
158
|
-
protected handleMassSaving(modalType: 'mass-update' | 'mass-selection', executePostCallback: PlainFunc): Promise<void>;
|
|
159
|
-
/** Anytime an input of the Composite Editor form changes, we'll add/remove a "modified" CSS className for styling purposes */
|
|
160
|
-
protected handleOnCompositeEditorChange(_e: Event, args: OnCompositeEditorChangeEventArgs): void;
|
|
161
|
-
/** Check wether the grid has the Row Selection enabled */
|
|
162
|
-
protected hasRowSelectionEnabled(): false | import("@slickgrid-universal/common").SlickCellSelectionModel | import("@slickgrid-universal/common").SlickRowSelectionModel | undefined;
|
|
163
|
-
/** Reset Form button handler */
|
|
164
|
-
protected handleResetFormClicked(): void;
|
|
165
|
-
/** switch case handler to determine which code to execute depending on the modal type */
|
|
166
|
-
protected handleSaveClicked(): void;
|
|
167
|
-
/** Insert an item into the DataView or throw an error when finding duplicate id in the dataset */
|
|
168
|
-
protected insertNewItemInDataView(item: any): void;
|
|
169
|
-
protected parseText(inputText: string, mappedArgs: any): string;
|
|
170
|
-
/** Put back the current row to its original item data context using the DataView without triggering a change */
|
|
171
|
-
protected resetCurrentRowDataContext(): void;
|
|
172
|
-
/** Validate all the Composite Editors that are defined in the form */
|
|
173
|
-
protected validateCompositeEditors(targetElm?: HTMLElement): EditorValidationResult;
|
|
174
|
-
/** Validate the current cell editor */
|
|
175
|
-
protected validateCurrentEditor(): void;
|
|
176
|
-
}
|
|
177
|
-
export {};
|
|
1
|
+
import { BindingEventService, Column, CompositeEditorLabel, CompositeEditorOpenDetailOption, CompositeEditorOption, ContainerService, DOMEvent, Editor, EditorValidationResult, ExternalResource, GridOption, GridService, Locale, OnErrorOption, OnCompositeEditorChangeEventArgs, PlainFunc, SlickDataView, SlickEventHandler, SlickGrid, TranslaterService } from '@slickgrid-universal/common';
|
|
2
|
+
type ApplyChangesCallbackFn = (formValues: {
|
|
3
|
+
[columnId: string]: any;
|
|
4
|
+
} | null, selection: {
|
|
5
|
+
gridRowIndexes: number[];
|
|
6
|
+
dataContextIds: Array<number | string>;
|
|
7
|
+
}, applyToDataview?: boolean) => any[] | void | undefined;
|
|
8
|
+
type DataSelection = {
|
|
9
|
+
gridRowIndexes: number[];
|
|
10
|
+
dataContextIds: Array<number | string>;
|
|
11
|
+
};
|
|
12
|
+
export declare class SlickCompositeEditorComponent implements ExternalResource {
|
|
13
|
+
protected _bindEventService: BindingEventService;
|
|
14
|
+
protected _columnDefinitions: Column[];
|
|
15
|
+
protected _compositeOptions: CompositeEditorOption;
|
|
16
|
+
protected _eventHandler: SlickEventHandler;
|
|
17
|
+
protected _itemDataContext: any;
|
|
18
|
+
protected _modalElm: HTMLDivElement;
|
|
19
|
+
protected _originalDataContext: any;
|
|
20
|
+
protected _options: CompositeEditorOpenDetailOption;
|
|
21
|
+
protected _lastActiveRowNumber: number;
|
|
22
|
+
protected _locales: Locale;
|
|
23
|
+
protected _formValues: {
|
|
24
|
+
[columnId: string]: any;
|
|
25
|
+
} | null;
|
|
26
|
+
protected _editors: {
|
|
27
|
+
[columnId: string]: Editor;
|
|
28
|
+
};
|
|
29
|
+
protected _editorContainers: Array<HTMLElement | null>;
|
|
30
|
+
protected _modalBodyTopValidationElm: HTMLDivElement;
|
|
31
|
+
protected _modalSaveButtonElm: HTMLButtonElement;
|
|
32
|
+
protected grid: SlickGrid;
|
|
33
|
+
protected gridService: GridService | null;
|
|
34
|
+
protected translaterService?: TranslaterService | null;
|
|
35
|
+
get eventHandler(): SlickEventHandler;
|
|
36
|
+
get dataView(): SlickDataView;
|
|
37
|
+
get dataViewLength(): number;
|
|
38
|
+
get formValues(): any;
|
|
39
|
+
get editors(): {
|
|
40
|
+
[columnId: string]: Editor;
|
|
41
|
+
};
|
|
42
|
+
set editors(editors: {
|
|
43
|
+
[columnId: string]: Editor;
|
|
44
|
+
});
|
|
45
|
+
get gridOptions(): GridOption;
|
|
46
|
+
constructor();
|
|
47
|
+
/**
|
|
48
|
+
* initialize the Composite Editor by passing the SlickGrid object and the container service
|
|
49
|
+
*
|
|
50
|
+
* Note: we aren't using DI in the constructor simply to be as framework agnostic as possible,
|
|
51
|
+
* we are simply using this init() function with a very basic container service to do the job
|
|
52
|
+
*/
|
|
53
|
+
init(grid: SlickGrid, containerService: ContainerService): void;
|
|
54
|
+
/** Dispose of the Component & unsubscribe all events */
|
|
55
|
+
dispose(): void;
|
|
56
|
+
/** Dispose of the Component without unsubscribing any events */
|
|
57
|
+
disposeComponent(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Dynamically change value of an input from the Composite Editor form.
|
|
60
|
+
*
|
|
61
|
+
* NOTE: user might get an error thrown when trying to apply a value on a Composite Editor that was not found in the form,
|
|
62
|
+
* but in some cases the user might still want the value to be applied to the formValues so that it will be sent to the save in final item data context
|
|
63
|
+
* and when that happens, you can just skip that error so it won't throw.
|
|
64
|
+
* @param {String | Column} columnIdOrDef - column id or column definition
|
|
65
|
+
* @param {*} newValue - the new value
|
|
66
|
+
* @param {Boolean} skipMissingEditorError - defaults to False, skipping the error when the Composite Editor was not found will allow to still apply the value into the formValues object
|
|
67
|
+
* @param {Boolean} triggerOnCompositeEditorChange - defaults to True, will this change trigger a onCompositeEditorChange event?
|
|
68
|
+
*/
|
|
69
|
+
changeFormInputValue(columnIdOrDef: string | Column, newValue: any, skipMissingEditorError?: boolean, triggerOnCompositeEditorChange?: boolean): void;
|
|
70
|
+
/**
|
|
71
|
+
* Dynamically update the `formValues` object directly without triggering the onCompositeEditorChange event.
|
|
72
|
+
* The fact that this doesn't trigger an event, might not always be good though, in these cases you are probably better with using the changeFormInputValue() method
|
|
73
|
+
* @param {String | Column} columnIdOrDef - column id or column definition
|
|
74
|
+
* @param {*} newValue - the new value
|
|
75
|
+
*/
|
|
76
|
+
changeFormValue(columnIdOrDef: string | Column, newValue: any): void;
|
|
77
|
+
/**
|
|
78
|
+
* Dynamically change an Editor option of the Composite Editor form
|
|
79
|
+
* For example, a use case could be to dynamically change the "minDate" of another Date Editor in the Composite Editor form.
|
|
80
|
+
* @param {String} columnId - column id
|
|
81
|
+
* @param {*} newValue - the new value
|
|
82
|
+
*/
|
|
83
|
+
changeFormEditorOption(columnId: string, optionName: string, newOptionValue: any): void;
|
|
84
|
+
/**
|
|
85
|
+
* Disable (or enable) an input of the Composite Editor form
|
|
86
|
+
* @param {String} columnId - column definition id
|
|
87
|
+
* @param isDisabled - defaults to True, are we disabling the associated form input
|
|
88
|
+
*/
|
|
89
|
+
disableFormInput(columnId: string, isDisabled?: boolean): void;
|
|
90
|
+
/** Entry point to initialize and open the Composite Editor modal window */
|
|
91
|
+
openDetails(options: CompositeEditorOpenDetailOption): SlickCompositeEditorComponent | null;
|
|
92
|
+
/** Cancel the Editing which will also close the modal window */
|
|
93
|
+
cancelEditing(): Promise<void>;
|
|
94
|
+
/** Show a Validation Summary text (as a <div>) when a validation fails or simply hide it when there's no error */
|
|
95
|
+
showValidationSummaryText(isShowing: boolean, errorMsg?: string): void;
|
|
96
|
+
/** Apply Mass Update Changes (form values) to the entire dataset */
|
|
97
|
+
protected applySaveMassUpdateChanges(formValues: any, _selection: DataSelection, applyToDataview?: boolean): any[];
|
|
98
|
+
/** Apply Mass Changes to the Selected rows in the grid (form values) */
|
|
99
|
+
protected applySaveMassSelectionChanges(formValues: any, selection: DataSelection, applyToDataview?: boolean): any[];
|
|
100
|
+
/**
|
|
101
|
+
* Auto-Calculate how many columns to display in the view layout (1, 2, or 3).
|
|
102
|
+
* We'll display a 1 column layout for 8 or less Editors, 2 columns layout for less than 15 Editors or 3 columns when more than 15 Editors
|
|
103
|
+
* @param {number} editorCount - how many Editors do we have in total
|
|
104
|
+
* @returns {number} count - calculated column count (1, 2 or 3)
|
|
105
|
+
*/
|
|
106
|
+
protected autoCalculateLayoutColumnCount(editorCount: number): number;
|
|
107
|
+
/**
|
|
108
|
+
* Create a reset button for each editor and attach a button click handler
|
|
109
|
+
* @param {String} columnId - column id
|
|
110
|
+
* @returns {Object} - html button
|
|
111
|
+
*/
|
|
112
|
+
protected createEditorResetButtonElement(columnId: string): HTMLButtonElement;
|
|
113
|
+
/**
|
|
114
|
+
* Create a form reset button and attach a button click handler
|
|
115
|
+
* @param {String} columnId - column id
|
|
116
|
+
* @returns {Object} - html button
|
|
117
|
+
*/
|
|
118
|
+
protected createFormResetButtonElement(): HTMLDivElement;
|
|
119
|
+
/**
|
|
120
|
+
* Execute the onError callback when defined
|
|
121
|
+
* or use the default onError callback which is to simply display the error in the console
|
|
122
|
+
*/
|
|
123
|
+
protected executeOnError(error: OnErrorOption): void;
|
|
124
|
+
/**
|
|
125
|
+
* A simple and generic method to execute the "OnSave" callback if it's defined by the user OR else simply execute built-in apply changes callback.
|
|
126
|
+
* This method deals with multiple callbacks as shown below
|
|
127
|
+
* @param {Function} applyChangesCallback - first callback to apply the changes into the grid (this could be a user custom callback)
|
|
128
|
+
* @param {Function} executePostCallback - second callback to execute right after the "onSave"
|
|
129
|
+
* @param {Function} beforeClosingCallback - third and last callback to execute after Saving but just before closing the modal window
|
|
130
|
+
* @param {Object} itemDataContext - item data context when modal type is (create/clone/edit)
|
|
131
|
+
*/
|
|
132
|
+
protected executeOnSave(applyChangesCallback: ApplyChangesCallbackFn, executePostCallback: PlainFunc, beforeClosingCallback?: PlainFunc, itemDataContext?: any): Promise<void>;
|
|
133
|
+
protected focusOnFirstColumnCellWithEditor(columns: Column[], dataContext: any, columnIndex: number, rowIndex: number, isWithMassChange: boolean): boolean;
|
|
134
|
+
protected findNextAvailableEditorColumnIndex(columns: Column[], dataContext: any, rowIndex: number, isWithMassUpdate: boolean): number;
|
|
135
|
+
/**
|
|
136
|
+
* Get a column definition by providing a column id OR a column definition.
|
|
137
|
+
* If the input is a string, we'll assume it's a columnId and we'll simply search for the column in the column definitions list
|
|
138
|
+
*/
|
|
139
|
+
protected getColumnByObjectOrId(columnIdOrDef: string | Column): Column | undefined;
|
|
140
|
+
protected getActiveCellEditor(row: number, cell: number): Editor | null;
|
|
141
|
+
/**
|
|
142
|
+
* Get the column label, the label might have an optional "columnGroup" (or "columnGroupKey" which need to be translated)
|
|
143
|
+
* @param {object} columnDef - column definition
|
|
144
|
+
* @returns {string} label - column label
|
|
145
|
+
*/
|
|
146
|
+
protected getColumnLabel(columnDef: Column): string;
|
|
147
|
+
/** Get the correct label text depending, if we use a Translater Service then translate the text when possible else use default text */
|
|
148
|
+
protected getLabelText(labelProperty: keyof CompositeEditorLabel, localeText: string, defaultText: string): string;
|
|
149
|
+
/** Retrieve the current selection of row indexes & data context Ids */
|
|
150
|
+
protected getCurrentRowSelections(): {
|
|
151
|
+
gridRowIndexes: number[];
|
|
152
|
+
dataContextIds: Array<string | number>;
|
|
153
|
+
};
|
|
154
|
+
protected handleBodyClicked(event: Event): void;
|
|
155
|
+
protected handleKeyDown(event: KeyboardEvent): void;
|
|
156
|
+
protected handleResetInputValue(event: DOMEvent<HTMLButtonElement>): void;
|
|
157
|
+
/** Callback which processes a Mass Update or Mass Selection Changes */
|
|
158
|
+
protected handleMassSaving(modalType: 'mass-update' | 'mass-selection', executePostCallback: PlainFunc): Promise<void>;
|
|
159
|
+
/** Anytime an input of the Composite Editor form changes, we'll add/remove a "modified" CSS className for styling purposes */
|
|
160
|
+
protected handleOnCompositeEditorChange(_e: Event, args: OnCompositeEditorChangeEventArgs): void;
|
|
161
|
+
/** Check wether the grid has the Row Selection enabled */
|
|
162
|
+
protected hasRowSelectionEnabled(): false | import("@slickgrid-universal/common").SlickCellSelectionModel | import("@slickgrid-universal/common").SlickRowSelectionModel | undefined;
|
|
163
|
+
/** Reset Form button handler */
|
|
164
|
+
protected handleResetFormClicked(): void;
|
|
165
|
+
/** switch case handler to determine which code to execute depending on the modal type */
|
|
166
|
+
protected handleSaveClicked(): void;
|
|
167
|
+
/** Insert an item into the DataView or throw an error when finding duplicate id in the dataset */
|
|
168
|
+
protected insertNewItemInDataView(item: any): void;
|
|
169
|
+
protected parseText(inputText: string, mappedArgs: any): string;
|
|
170
|
+
/** Put back the current row to its original item data context using the DataView without triggering a change */
|
|
171
|
+
protected resetCurrentRowDataContext(): void;
|
|
172
|
+
/** Validate all the Composite Editors that are defined in the form */
|
|
173
|
+
protected validateCompositeEditors(targetElm?: HTMLElement): EditorValidationResult;
|
|
174
|
+
/** Validate the current cell editor */
|
|
175
|
+
protected validateCurrentEditor(): void;
|
|
176
|
+
}
|
|
177
|
+
export {};
|
|
178
|
+
//# sourceMappingURL=slick-composite-editor.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slick-composite-editor.component.d.ts","sourceRoot":"","sources":["../../src/slick-composite-editor.component.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,MAAM,EACN,oBAAoB,EAEpB,+BAA+B,EAC/B,qBAAqB,EAErB,gBAAgB,EAEhB,QAAQ,EACR,MAAM,EACN,sBAAsB,EACtB,gBAAgB,EAEhB,UAAU,EACV,WAAW,EACX,MAAM,EAEN,aAAa,EACb,gCAAgC,EAChC,SAAS,EAGT,aAAa,EACb,iBAAiB,EACjB,SAAS,EAGT,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAQrC,KAAK,sBAAsB,GAAG,CAC5B,UAAU,EAAE;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CAAE,GAAG,IAAI,EAC/C,SAAS,EAAE;IAAE,cAAc,EAAE,MAAM,EAAE,CAAC;IAAC,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CAAE,EAChF,eAAe,CA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AW,EAAE,MAAM,GAAG,MAAM;IAUlH,uEAAuE;IACvE,SAAS,CAAC,uBAAuB,IAAI;QAAE,cAAc,EAAE,MAAM,EAAE,CAAC;QAAC,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;KAAE;IAQ1G,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK;IAQxC,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa;IAU5C,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IASlE,uEAAuE;cACvD,gBAAgB,CAAC,SAAS,EAAE,aAAa,GAAG,gBAAgB,EAAE,mBAAmB,EAAE,SAAS;IAS5G,8HAA8H;IAC9H,SAAS,CAAC,6BAA6B,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,gCAAgC;IAqBzF,0DAA0D;IAC1D,SAAS,CAAC,sBAAsB;IAMhC,gCAAgC;IAChC,SAAS,CAAC,sBAAsB;IAWhC,yFAAyF;IACzF,SAAS,CAAC,iBAAiB;IAyD3B,kGAAkG;IAClG,SAAS,CAAC,uBAAuB,CAAC,IAAI,EAAE,GAAG;IAY3C,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,MAAM;IAM/D,gHAAgH;IAChH,SAAS,CAAC,0BAA0B;IAMpC,sEAAsE;IACtE,SAAS,CAAC,wBAAwB,CAAC,SAAS,CAAC,EAAE,WAAW,GAAG,sBAAsB;IAUnF,uCAAuC;IACvC,SAAS,CAAC,qBAAqB;CAMhC"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slickgrid-universal/composite-editor-component",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Slick Composite Editor Component - Vanilla Implementation of a Composite Editor Modal Window Component",
|
|
5
5
|
"main": "dist/commonjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"browser": "./dist/esm/index.js",
|
|
10
9
|
"import": "./dist/esm/index.js",
|
|
11
|
-
"require": "./dist/commonjs/index.js"
|
|
10
|
+
"require": "./dist/commonjs/index.js",
|
|
11
|
+
"default": "./dist/esm/index.js"
|
|
12
12
|
},
|
|
13
13
|
"./*": "./*"
|
|
14
14
|
},
|
|
15
15
|
"typesVersions": {
|
|
16
16
|
"*": {
|
|
17
17
|
"*": [
|
|
18
|
-
"./dist/
|
|
18
|
+
"./dist/types/index.d.ts"
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
"types": "dist/
|
|
22
|
+
"types": "dist/types/index.d.ts",
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"not dead"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@slickgrid-universal/common": "~2.
|
|
47
|
-
"@slickgrid-universal/utils": "~2.
|
|
46
|
+
"@slickgrid-universal/common": "~2.6.0",
|
|
47
|
+
"@slickgrid-universal/utils": "~2.6.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9cddf3ee91a91ca829d0ced99c1f20f6d0e9941f"
|
|
50
50
|
}
|
package/dist/commonjs/index.d.ts
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { BindingEventService, Column, CompositeEditorLabel, CompositeEditorOpenDetailOption, CompositeEditorOption, ContainerService, DOMEvent, Editor, EditorValidationResult, ExternalResource, GridOption, GridService, Locale, OnErrorOption, OnCompositeEditorChangeEventArgs, PlainFunc, SlickDataView, SlickEventHandler, SlickGrid, TranslaterService } from '@slickgrid-universal/common';
|
|
2
|
-
type ApplyChangesCallbackFn = (formValues: {
|
|
3
|
-
[columnId: string]: any;
|
|
4
|
-
} | null, selection: {
|
|
5
|
-
gridRowIndexes: number[];
|
|
6
|
-
dataContextIds: Array<number | string>;
|
|
7
|
-
}, applyToDataview?: boolean) => any[] | void | undefined;
|
|
8
|
-
type DataSelection = {
|
|
9
|
-
gridRowIndexes: number[];
|
|
10
|
-
dataContextIds: Array<number | string>;
|
|
11
|
-
};
|
|
12
|
-
export declare class SlickCompositeEditorComponent implements ExternalResource {
|
|
13
|
-
protected _bindEventService: BindingEventService;
|
|
14
|
-
protected _columnDefinitions: Column[];
|
|
15
|
-
protected _compositeOptions: CompositeEditorOption;
|
|
16
|
-
protected _eventHandler: SlickEventHandler;
|
|
17
|
-
protected _itemDataContext: any;
|
|
18
|
-
protected _modalElm: HTMLDivElement;
|
|
19
|
-
protected _originalDataContext: any;
|
|
20
|
-
protected _options: CompositeEditorOpenDetailOption;
|
|
21
|
-
protected _lastActiveRowNumber: number;
|
|
22
|
-
protected _locales: Locale;
|
|
23
|
-
protected _formValues: {
|
|
24
|
-
[columnId: string]: any;
|
|
25
|
-
} | null;
|
|
26
|
-
protected _editors: {
|
|
27
|
-
[columnId: string]: Editor;
|
|
28
|
-
};
|
|
29
|
-
protected _editorContainers: Array<HTMLElement | null>;
|
|
30
|
-
protected _modalBodyTopValidationElm: HTMLDivElement;
|
|
31
|
-
protected _modalSaveButtonElm: HTMLButtonElement;
|
|
32
|
-
protected grid: SlickGrid;
|
|
33
|
-
protected gridService: GridService | null;
|
|
34
|
-
protected translaterService?: TranslaterService | null;
|
|
35
|
-
get eventHandler(): SlickEventHandler;
|
|
36
|
-
get dataView(): SlickDataView;
|
|
37
|
-
get dataViewLength(): number;
|
|
38
|
-
get formValues(): any;
|
|
39
|
-
get editors(): {
|
|
40
|
-
[columnId: string]: Editor;
|
|
41
|
-
};
|
|
42
|
-
set editors(editors: {
|
|
43
|
-
[columnId: string]: Editor;
|
|
44
|
-
});
|
|
45
|
-
get gridOptions(): GridOption;
|
|
46
|
-
constructor();
|
|
47
|
-
/**
|
|
48
|
-
* initialize the Composite Editor by passing the SlickGrid object and the container service
|
|
49
|
-
*
|
|
50
|
-
* Note: we aren't using DI in the constructor simply to be as framework agnostic as possible,
|
|
51
|
-
* we are simply using this init() function with a very basic container service to do the job
|
|
52
|
-
*/
|
|
53
|
-
init(grid: SlickGrid, containerService: ContainerService): void;
|
|
54
|
-
/** Dispose of the Component & unsubscribe all events */
|
|
55
|
-
dispose(): void;
|
|
56
|
-
/** Dispose of the Component without unsubscribing any events */
|
|
57
|
-
disposeComponent(): void;
|
|
58
|
-
/**
|
|
59
|
-
* Dynamically change value of an input from the Composite Editor form.
|
|
60
|
-
*
|
|
61
|
-
* NOTE: user might get an error thrown when trying to apply a value on a Composite Editor that was not found in the form,
|
|
62
|
-
* but in some cases the user might still want the value to be applied to the formValues so that it will be sent to the save in final item data context
|
|
63
|
-
* and when that happens, you can just skip that error so it won't throw.
|
|
64
|
-
* @param {String | Column} columnIdOrDef - column id or column definition
|
|
65
|
-
* @param {*} newValue - the new value
|
|
66
|
-
* @param {Boolean} skipMissingEditorError - defaults to False, skipping the error when the Composite Editor was not found will allow to still apply the value into the formValues object
|
|
67
|
-
* @param {Boolean} triggerOnCompositeEditorChange - defaults to True, will this change trigger a onCompositeEditorChange event?
|
|
68
|
-
*/
|
|
69
|
-
changeFormInputValue(columnIdOrDef: string | Column, newValue: any, skipMissingEditorError?: boolean, triggerOnCompositeEditorChange?: boolean): void;
|
|
70
|
-
/**
|
|
71
|
-
* Dynamically update the `formValues` object directly without triggering the onCompositeEditorChange event.
|
|
72
|
-
* The fact that this doesn't trigger an event, might not always be good though, in these cases you are probably better with using the changeFormInputValue() method
|
|
73
|
-
* @param {String | Column} columnIdOrDef - column id or column definition
|
|
74
|
-
* @param {*} newValue - the new value
|
|
75
|
-
*/
|
|
76
|
-
changeFormValue(columnIdOrDef: string | Column, newValue: any): void;
|
|
77
|
-
/**
|
|
78
|
-
* Dynamically change an Editor option of the Composite Editor form
|
|
79
|
-
* For example, a use case could be to dynamically change the "minDate" of another Date Editor in the Composite Editor form.
|
|
80
|
-
* @param {String} columnId - column id
|
|
81
|
-
* @param {*} newValue - the new value
|
|
82
|
-
*/
|
|
83
|
-
changeFormEditorOption(columnId: string, optionName: string, newOptionValue: any): void;
|
|
84
|
-
/**
|
|
85
|
-
* Disable (or enable) an input of the Composite Editor form
|
|
86
|
-
* @param {String} columnId - column definition id
|
|
87
|
-
* @param isDisabled - defaults to True, are we disabling the associated form input
|
|
88
|
-
*/
|
|
89
|
-
disableFormInput(columnId: string, isDisabled?: boolean): void;
|
|
90
|
-
/** Entry point to initialize and open the Composite Editor modal window */
|
|
91
|
-
openDetails(options: CompositeEditorOpenDetailOption): SlickCompositeEditorComponent | null;
|
|
92
|
-
/** Cancel the Editing which will also close the modal window */
|
|
93
|
-
cancelEditing(): Promise<void>;
|
|
94
|
-
/** Show a Validation Summary text (as a <div>) when a validation fails or simply hide it when there's no error */
|
|
95
|
-
showValidationSummaryText(isShowing: boolean, errorMsg?: string): void;
|
|
96
|
-
/** Apply Mass Update Changes (form values) to the entire dataset */
|
|
97
|
-
protected applySaveMassUpdateChanges(formValues: any, _selection: DataSelection, applyToDataview?: boolean): any[];
|
|
98
|
-
/** Apply Mass Changes to the Selected rows in the grid (form values) */
|
|
99
|
-
protected applySaveMassSelectionChanges(formValues: any, selection: DataSelection, applyToDataview?: boolean): any[];
|
|
100
|
-
/**
|
|
101
|
-
* Auto-Calculate how many columns to display in the view layout (1, 2, or 3).
|
|
102
|
-
* We'll display a 1 column layout for 8 or less Editors, 2 columns layout for less than 15 Editors or 3 columns when more than 15 Editors
|
|
103
|
-
* @param {number} editorCount - how many Editors do we have in total
|
|
104
|
-
* @returns {number} count - calculated column count (1, 2 or 3)
|
|
105
|
-
*/
|
|
106
|
-
protected autoCalculateLayoutColumnCount(editorCount: number): number;
|
|
107
|
-
/**
|
|
108
|
-
* Create a reset button for each editor and attach a button click handler
|
|
109
|
-
* @param {String} columnId - column id
|
|
110
|
-
* @returns {Object} - html button
|
|
111
|
-
*/
|
|
112
|
-
protected createEditorResetButtonElement(columnId: string): HTMLButtonElement;
|
|
113
|
-
/**
|
|
114
|
-
* Create a form reset button and attach a button click handler
|
|
115
|
-
* @param {String} columnId - column id
|
|
116
|
-
* @returns {Object} - html button
|
|
117
|
-
*/
|
|
118
|
-
protected createFormResetButtonElement(): HTMLDivElement;
|
|
119
|
-
/**
|
|
120
|
-
* Execute the onError callback when defined
|
|
121
|
-
* or use the default onError callback which is to simply display the error in the console
|
|
122
|
-
*/
|
|
123
|
-
protected executeOnError(error: OnErrorOption): void;
|
|
124
|
-
/**
|
|
125
|
-
* A simple and generic method to execute the "OnSave" callback if it's defined by the user OR else simply execute built-in apply changes callback.
|
|
126
|
-
* This method deals with multiple callbacks as shown below
|
|
127
|
-
* @param {Function} applyChangesCallback - first callback to apply the changes into the grid (this could be a user custom callback)
|
|
128
|
-
* @param {Function} executePostCallback - second callback to execute right after the "onSave"
|
|
129
|
-
* @param {Function} beforeClosingCallback - third and last callback to execute after Saving but just before closing the modal window
|
|
130
|
-
* @param {Object} itemDataContext - item data context when modal type is (create/clone/edit)
|
|
131
|
-
*/
|
|
132
|
-
protected executeOnSave(applyChangesCallback: ApplyChangesCallbackFn, executePostCallback: PlainFunc, beforeClosingCallback?: PlainFunc, itemDataContext?: any): Promise<void>;
|
|
133
|
-
protected focusOnFirstColumnCellWithEditor(columns: Column[], dataContext: any, columnIndex: number, rowIndex: number, isWithMassChange: boolean): boolean;
|
|
134
|
-
protected findNextAvailableEditorColumnIndex(columns: Column[], dataContext: any, rowIndex: number, isWithMassUpdate: boolean): number;
|
|
135
|
-
/**
|
|
136
|
-
* Get a column definition by providing a column id OR a column definition.
|
|
137
|
-
* If the input is a string, we'll assume it's a columnId and we'll simply search for the column in the column definitions list
|
|
138
|
-
*/
|
|
139
|
-
protected getColumnByObjectOrId(columnIdOrDef: string | Column): Column | undefined;
|
|
140
|
-
protected getActiveCellEditor(row: number, cell: number): Editor | null;
|
|
141
|
-
/**
|
|
142
|
-
* Get the column label, the label might have an optional "columnGroup" (or "columnGroupKey" which need to be translated)
|
|
143
|
-
* @param {object} columnDef - column definition
|
|
144
|
-
* @returns {string} label - column label
|
|
145
|
-
*/
|
|
146
|
-
protected getColumnLabel(columnDef: Column): string;
|
|
147
|
-
/** Get the correct label text depending, if we use a Translater Service then translate the text when possible else use default text */
|
|
148
|
-
protected getLabelText(labelProperty: keyof CompositeEditorLabel, localeText: string, defaultText: string): string;
|
|
149
|
-
/** Retrieve the current selection of row indexes & data context Ids */
|
|
150
|
-
protected getCurrentRowSelections(): {
|
|
151
|
-
gridRowIndexes: number[];
|
|
152
|
-
dataContextIds: Array<string | number>;
|
|
153
|
-
};
|
|
154
|
-
protected handleBodyClicked(event: Event): void;
|
|
155
|
-
protected handleKeyDown(event: KeyboardEvent): void;
|
|
156
|
-
protected handleResetInputValue(event: DOMEvent<HTMLButtonElement>): void;
|
|
157
|
-
/** Callback which processes a Mass Update or Mass Selection Changes */
|
|
158
|
-
protected handleMassSaving(modalType: 'mass-update' | 'mass-selection', executePostCallback: PlainFunc): Promise<void>;
|
|
159
|
-
/** Anytime an input of the Composite Editor form changes, we'll add/remove a "modified" CSS className for styling purposes */
|
|
160
|
-
protected handleOnCompositeEditorChange(_e: Event, args: OnCompositeEditorChangeEventArgs): void;
|
|
161
|
-
/** Check wether the grid has the Row Selection enabled */
|
|
162
|
-
protected hasRowSelectionEnabled(): false | import("@slickgrid-universal/common").SlickCellSelectionModel | import("@slickgrid-universal/common").SlickRowSelectionModel | undefined;
|
|
163
|
-
/** Reset Form button handler */
|
|
164
|
-
protected handleResetFormClicked(): void;
|
|
165
|
-
/** switch case handler to determine which code to execute depending on the modal type */
|
|
166
|
-
protected handleSaveClicked(): void;
|
|
167
|
-
/** Insert an item into the DataView or throw an error when finding duplicate id in the dataset */
|
|
168
|
-
protected insertNewItemInDataView(item: any): void;
|
|
169
|
-
protected parseText(inputText: string, mappedArgs: any): string;
|
|
170
|
-
/** Put back the current row to its original item data context using the DataView without triggering a change */
|
|
171
|
-
protected resetCurrentRowDataContext(): void;
|
|
172
|
-
/** Validate all the Composite Editors that are defined in the form */
|
|
173
|
-
protected validateCompositeEditors(targetElm?: HTMLElement): EditorValidationResult;
|
|
174
|
-
/** Validate the current cell editor */
|
|
175
|
-
protected validateCurrentEditor(): void;
|
|
176
|
-
}
|
|
177
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Column, CompositeEditorOption, EditorArguments } from '@slickgrid-universal/common';
|
|
2
|
-
export interface CompositeEditorArguments extends EditorArguments {
|
|
3
|
-
formValues: any;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* A composite SlickGrid editor factory.
|
|
7
|
-
* Generates an editor that is composed of multiple editors for given columns.
|
|
8
|
-
* Individual editors are provided given containers instead of the original cell.
|
|
9
|
-
* Validation will be performed on all editors individually and the results will be aggregated into one
|
|
10
|
-
* validation result.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* The returned editor will have its prototype set to CompositeEditor, so you can use the "instanceof" check.
|
|
14
|
-
*
|
|
15
|
-
* NOTE: This doesn't work for detached editors since they will be created and positioned relative to the
|
|
16
|
-
* active cell and not the provided container.
|
|
17
|
-
*
|
|
18
|
-
* @class CompositeEditor
|
|
19
|
-
* @constructor
|
|
20
|
-
* @param columns {Array} Column definitions from which editors will be pulled.
|
|
21
|
-
* @param containers {Array} Container HTMLElements in which editors will be placed.
|
|
22
|
-
* @param options {Object} Options hash:
|
|
23
|
-
* validationFailedMsg - A generic failed validation message set on the aggregated validation resuls.
|
|
24
|
-
* validationMsgPrefix - Add an optional prefix to each validation message (only the ones shown in the modal form, not the ones in the "errors")
|
|
25
|
-
* modalType - Defaults to "edit", modal type can 1 of these 3: (create, edit, mass, mass-selection)
|
|
26
|
-
* hide - A function to be called when the grid asks the editor to hide itself.
|
|
27
|
-
* show - A function to be called when the grid asks the editor to show itself.
|
|
28
|
-
* position - A function to be called when the grid asks the editor to reposition itself.
|
|
29
|
-
* destroy - A function to be called when the editor is destroyed.
|
|
30
|
-
*/
|
|
31
|
-
export declare function CompositeEditor(this: any, columns: Column[], containers: Array<HTMLDivElement>, options: CompositeEditorOption): {
|
|
32
|
-
(this: any, args: EditorArguments): void;
|
|
33
|
-
prototype: any;
|
|
34
|
-
};
|