@zeedhi/teknisa-components-common 3.0.0 → 3.0.2
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/.package.json +5 -2
- package/dist/teknisa-components-common.js +3722 -32
- package/dist/teknisa-components-common.min.js +3722 -32
- package/dist/types/components/index.d.ts +5 -0
- package/dist/types/components/tek-datasource/index.d.ts +3 -0
- package/dist/types/components/tek-datasource/interfaces.d.ts +16 -0
- package/dist/types/components/tek-datasource/tek-memory-datasource.d.ts +93 -0
- package/dist/types/components/tek-datasource/tek-rest-datasource.d.ts +95 -0
- package/dist/types/components/tek-grid/columns-searcher.d.ts +5 -0
- package/dist/types/components/tek-grid/dynamic-filter-datasource-factory.d.ts +6 -0
- package/dist/types/components/tek-grid/filter-helper.d.ts +7 -0
- package/dist/types/components/tek-grid/grid-filter-button.d.ts +29 -0
- package/dist/types/components/tek-grid/grouped-data-manager.d.ts +82 -0
- package/dist/types/components/tek-grid/grouped-data-selector.d.ts +7 -0
- package/dist/types/components/tek-grid/grouped-view-navigator.d.ts +14 -0
- package/dist/types/components/tek-grid/index.d.ts +18 -0
- package/dist/types/components/tek-grid/interfaces.d.ts +259 -0
- package/dist/types/components/tek-grid/keymap-grouped.d.ts +6 -0
- package/dist/types/components/tek-grid/layout-options.d.ts +39 -0
- package/dist/types/components/tek-grid/tek-grid-column.d.ts +42 -0
- package/dist/types/components/tek-grid/tek-grid-columns-button/tek-grid-columns-button-controller.d.ts +8 -0
- package/dist/types/components/tek-grid/tek-grid-columns-button/tek-grid-columns-button.d.ts +13 -0
- package/dist/types/components/tek-grid/tek-grid-controller.d.ts +31 -0
- package/dist/types/components/tek-grid/tek-grid-events.d.ts +31 -0
- package/dist/types/components/tek-grid/tek-grid-toolbar-provider/export-options/button-option.d.ts +17 -0
- package/dist/types/components/tek-grid/tek-grid-toolbar-provider/export-options/index.d.ts +3 -0
- package/dist/types/components/tek-grid/tek-grid-toolbar-provider/export-options/interfaces.d.ts +5 -0
- package/dist/types/components/tek-grid/tek-grid-toolbar-provider/export-options/multi-option.d.ts +12 -0
- package/dist/types/components/tek-grid/tek-grid-toolbar-provider/index.d.ts +2 -0
- package/dist/types/components/tek-grid/tek-grid-toolbar-provider/tek-grid-toolbar-provider.d.ts +22 -0
- package/dist/types/components/tek-grid/tek-grid.d.ts +216 -0
- package/dist/types/components/tek-user-info/TekUserInfoController.d.ts +22 -0
- package/dist/types/components/tek-user-info/interfaces.d.ts +27 -0
- package/dist/types/components/tek-user-info/tek-user-info-list.d.ts +32 -0
- package/dist/types/components/tek-user-info/tek-user-info.d.ts +37 -0
- package/dist/types/error/tek-grid-delete-rows-error.d.ts +7 -0
- package/dist/types/error/teknisa-common-error.d.ts +6 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/config/config.d.ts +7 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/is-filled-object/is-filled-object.d.ts +2 -0
- package/dist/types/utils/is-nil.d.ts +1 -0
- package/package.json +2 -2
- package/src/components/index.ts +5 -12
- package/src/components/tek-datasource/index.ts +3 -0
- package/src/components/tek-datasource/interfaces.ts +36 -0
- package/src/components/tek-datasource/tek-memory-datasource.ts +314 -0
- package/src/components/tek-datasource/tek-rest-datasource.ts +224 -0
- package/src/components/tek-grid/columns-searcher.ts +22 -0
- package/src/components/tek-grid/dynamic-filter-datasource-factory.ts +20 -0
- package/src/components/tek-grid/filter-helper.ts +20 -0
- package/src/components/tek-grid/grid-filter-button.ts +419 -0
- package/src/components/tek-grid/grouped-data-manager.ts +448 -0
- package/src/components/tek-grid/grouped-data-selector.ts +40 -0
- package/src/components/tek-grid/grouped-view-navigator.ts +84 -0
- package/src/components/tek-grid/index.ts +18 -0
- package/src/components/tek-grid/interfaces.ts +329 -0
- package/src/components/tek-grid/keymap-grouped.ts +20 -0
- package/src/components/tek-grid/layout-options.ts +248 -0
- package/src/components/tek-grid/tek-grid-column.ts +193 -0
- package/src/components/tek-grid/tek-grid-columns-button/tek-grid-columns-button-controller.ts +28 -0
- package/src/components/tek-grid/tek-grid-columns-button/tek-grid-columns-button.ts +38 -0
- package/src/components/tek-grid/tek-grid-controller.ts +140 -0
- package/src/components/tek-grid/tek-grid-events.ts +105 -0
- package/src/components/tek-grid/tek-grid-toolbar-provider/export-options/button-option.ts +26 -0
- package/src/components/tek-grid/tek-grid-toolbar-provider/export-options/index.ts +3 -0
- package/src/components/tek-grid/tek-grid-toolbar-provider/export-options/interfaces.ts +6 -0
- package/src/components/tek-grid/tek-grid-toolbar-provider/export-options/multi-option.ts +85 -0
- package/src/components/tek-grid/tek-grid-toolbar-provider/index.ts +2 -0
- package/src/components/tek-grid/tek-grid-toolbar-provider/tek-grid-toolbar-provider.ts +365 -0
- package/src/components/tek-grid/tek-grid.ts +1118 -0
- package/src/components/tek-user-info/TekUserInfoController.ts +87 -0
- package/src/components/tek-user-info/interfaces.ts +21 -0
- package/src/components/tek-user-info/tek-user-info-list.ts +64 -0
- package/src/components/tek-user-info/tek-user-info.ts +337 -0
- package/src/error/tek-grid-delete-rows-error.ts +15 -0
- package/src/error/teknisa-common-error.ts +8 -0
- package/src/index.ts +1 -0
- package/src/utils/config/config.ts +8 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/is-filled-object/is-filled-object.ts +5 -0
- package/src/utils/is-nil.ts +3 -0
- package/tests/unit/components/tek-grid/button-option.spec.ts +49 -0
- package/tests/unit/components/tek-grid/columns-searcher.spec.ts +112 -0
- package/tests/unit/components/tek-grid/dynamic-filter-datasource-factory.spec.ts +90 -0
- package/tests/unit/components/tek-grid/filter-helper.spec.ts +34 -130
- package/tests/unit/components/tek-grid/grid-filter-button.spec.ts +110 -241
- package/tests/unit/components/tek-grid/grouped-data-manager.spec.ts +593 -0
- package/tests/unit/components/tek-grid/grouped-data-selector.spec.ts +136 -0
- package/tests/unit/components/tek-grid/grouped-view-navigator.spec.ts +244 -0
- package/tests/unit/components/tek-grid/keymap-grouped.spec.ts +20 -0
- package/tests/unit/components/tek-grid/{layout_options.spec.ts → layout-options.spec.ts} +77 -35
- package/tests/unit/components/tek-grid/multi-option.spec.ts +139 -0
- package/tests/unit/components/tek-grid/{grid-column.spec.ts → tek-grid-column.spec.ts} +48 -6
- package/tests/unit/components/tek-grid/{grid-columns-button.spec.ts → tek-grid-columns-button.spec.ts} +42 -9
- package/tests/unit/components/tek-grid/tek-grid-controller.spec.ts +253 -0
- package/tests/unit/components/tek-grid/tek-grid-events.spec.ts +186 -0
- package/tests/unit/components/tek-grid/tek-grid-toolbar-provider.spec.ts +34 -0
- package/tests/unit/components/tek-grid/tek-grid.spec.ts +895 -0
- package/tests/unit/components/tek-grid/tek-memory-datasource.spec.ts +482 -0
- package/tests/unit/components/tek-grid/tek-rest-datasource.spec.ts +422 -0
- package/dist/types/error/delete-rows-error.d.ts +0 -6
- package/src/error/delete-rows-error.ts +0 -11
- package/tests/unit/components/tek-grid/grid.spec.ts +0 -2701
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { IEventParam, Metadata } from '@zeedhi/core';
|
|
2
|
+
import { TekGridDeleteRowsError } from '../../../error/tek-grid-delete-rows-error';
|
|
3
|
+
import { IComponentRender, IGridEditable, Tag } from '@zeedhi/common';
|
|
4
|
+
import {
|
|
5
|
+
IExportable,
|
|
6
|
+
ISupportsToolbar,
|
|
7
|
+
ITekGridAtoms,
|
|
8
|
+
ITekGridExportConfig,
|
|
9
|
+
ITekGridToolbarProvider,
|
|
10
|
+
} from '../interfaces';
|
|
11
|
+
import { ButtonOption, MultiOption } from './export-options';
|
|
12
|
+
|
|
13
|
+
type GridEditableWithToolbar = IGridEditable & ISupportsToolbar & IExportable;
|
|
14
|
+
|
|
15
|
+
export class TekGridToolbarProvider implements ITekGridToolbarProvider {
|
|
16
|
+
private grid: GridEditableWithToolbar;
|
|
17
|
+
|
|
18
|
+
private groupsVisibility: 'hide' | 'show';
|
|
19
|
+
|
|
20
|
+
constructor(grid: GridEditableWithToolbar, groupsVisibility: 'hide' | 'show') {
|
|
21
|
+
this.grid = grid;
|
|
22
|
+
this.groupsVisibility = groupsVisibility;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
protected atoms: ITekGridAtoms = {
|
|
26
|
+
TITLE: '_gridTitle',
|
|
27
|
+
HIDE_BUTTON: '_hideButton',
|
|
28
|
+
ADD_BUTTON: '_addButton',
|
|
29
|
+
DELETE_BUTTON: '_deleteButton',
|
|
30
|
+
REFRESH_BUTTON: '_refreshButton',
|
|
31
|
+
COLUMNS_BUTTON: '_columnsButton',
|
|
32
|
+
LAYOUT_BUTTON: '_layout_options',
|
|
33
|
+
EXPORT_BUTTON: '_exportButton',
|
|
34
|
+
ACTIONS_BUTTON: '_actionsButton',
|
|
35
|
+
SAVE_BUTTON: '_saveButton',
|
|
36
|
+
CANCEL_BUTTON: '_cancelButton',
|
|
37
|
+
SEARCH: '_gridSearch',
|
|
38
|
+
FILTER_BUTTON: '_filterButton',
|
|
39
|
+
FILTER_MODAL: '-filter-modal',
|
|
40
|
+
FILTER_FORM: '-filter-form',
|
|
41
|
+
EXPORT_DROPDOWN: '_export_dropdown',
|
|
42
|
+
ACTIONS_DROPDOWN: '_actions_dropdown',
|
|
43
|
+
HIDE_TOOLTIP: '_hideTooltip',
|
|
44
|
+
TOOLBAR_DIV: '_toolbarDiv',
|
|
45
|
+
NOT_EDITING_SPAN: '_notEditingSpan',
|
|
46
|
+
ADD_TOOLTIP: '_add_tooltip',
|
|
47
|
+
DELETE_TOOLTIP: '_delete_tooltip',
|
|
48
|
+
DIVIDER1: '_divider1',
|
|
49
|
+
REFRESH_TOOLTIP: '_refresh_tooltip',
|
|
50
|
+
DIVIDER2: '_divider2',
|
|
51
|
+
COLUMNS_TOOLTIP: '_columns_button_tooltip',
|
|
52
|
+
DIVIDER_ACTIONS: '_dividerActions',
|
|
53
|
+
DIVIDER3: '_divider3',
|
|
54
|
+
FILTER_TOOLTIP: '_filter_tooltip',
|
|
55
|
+
} as const;
|
|
56
|
+
|
|
57
|
+
getAtomName(key: keyof ITekGridAtoms): string {
|
|
58
|
+
return `${this.grid.name}${this.atoms[key]}`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
getAtomInstance<T>(key: keyof ITekGridAtoms): T {
|
|
62
|
+
return Metadata.getInstance<T>(`${this.grid.name}${this.atoms[key]}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private getOption(config: ITekGridExportConfig) {
|
|
66
|
+
if (config.multiOption) return new MultiOption(config);
|
|
67
|
+
|
|
68
|
+
return new ButtonOption(config);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private getExportConfigButtons(): IComponentRender[] {
|
|
72
|
+
return this.grid.exportConfig.map((config) => {
|
|
73
|
+
const option = this.getOption(config);
|
|
74
|
+
return option.buildComponent(this.grid);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private hideButtonClick({ event }: IEventParam<any>) {
|
|
79
|
+
if (!event!.defaultPrevented) {
|
|
80
|
+
const instance = Metadata.getInstance<Tag>(`${this.grid.name}_toolbarDiv`);
|
|
81
|
+
if (instance) {
|
|
82
|
+
instance.isVisible = !instance.isVisible;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private cancelChanges({ event }: IEventParam<any>) {
|
|
88
|
+
this.grid.callEvent('beforeCancel', { component: this.grid, event });
|
|
89
|
+
if (!event!.defaultPrevented) {
|
|
90
|
+
const cancel = async () => {
|
|
91
|
+
await this.grid.cancelEditedRows();
|
|
92
|
+
this.grid.editingNewRows = false;
|
|
93
|
+
};
|
|
94
|
+
cancel();
|
|
95
|
+
|
|
96
|
+
this.grid.callEvent('afterCancel', { component: this.grid });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
private saveChanges({ event }: IEventParam<any>) {
|
|
101
|
+
this.grid.callEvent('beforeSave', { component: this.grid, event });
|
|
102
|
+
if (!event!.defaultPrevented) {
|
|
103
|
+
const save = async () => {
|
|
104
|
+
await this.grid.saveEditedRows();
|
|
105
|
+
this.grid.editingNewRows = false;
|
|
106
|
+
};
|
|
107
|
+
save();
|
|
108
|
+
this.grid.callEvent('afterSave', { component: this.grid });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private addButtonClick({ event }: IEventParam<any>) {
|
|
113
|
+
if (this.grid.editNewRowsOnly) {
|
|
114
|
+
this.grid.editingNewRows = true;
|
|
115
|
+
}
|
|
116
|
+
this.grid.callEvent('addClick', { component: this.grid, event });
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
private deleteButtonClick({ event }: IEventParam<any>) {
|
|
120
|
+
this.grid.callEvent('beforeDelete', { component: this.grid, event });
|
|
121
|
+
if (!event!.defaultPrevented) {
|
|
122
|
+
if (this.grid.selectAllPages) {
|
|
123
|
+
throw new TekGridDeleteRowsError();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
this.grid.deleteRows();
|
|
127
|
+
|
|
128
|
+
this.grid.callEvent('afterDelete', { component: this.grid });
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
public reloadGrid({ event }: IEventParam<any>) {
|
|
133
|
+
this.grid.callEvent('beforeReload', { component: this.grid, event });
|
|
134
|
+
if (event?.defaultPrevented) return;
|
|
135
|
+
|
|
136
|
+
this.grid.reload();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public getProperties(): IComponentRender[] {
|
|
140
|
+
const exportConfigButtons = this.getExportConfigButtons();
|
|
141
|
+
|
|
142
|
+
return [
|
|
143
|
+
{
|
|
144
|
+
name: this.getAtomName('TITLE'),
|
|
145
|
+
component: 'ZdText',
|
|
146
|
+
cssClass: 'toolbar-title',
|
|
147
|
+
tag: 'h2',
|
|
148
|
+
text: this.grid.title,
|
|
149
|
+
title: this.grid.title,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: `${this.grid.name}_spacer`,
|
|
153
|
+
component: 'VSpacer',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: this.getAtomName('HIDE_TOOLTIP'),
|
|
157
|
+
component: 'ZdTooltip',
|
|
158
|
+
label: `{{GridController_${this.grid.name}.tooltipName}}`,
|
|
159
|
+
bottom: true,
|
|
160
|
+
children: [
|
|
161
|
+
{
|
|
162
|
+
name: this.getAtomName('HIDE_BUTTON'),
|
|
163
|
+
component: 'ZdButton',
|
|
164
|
+
flat: true,
|
|
165
|
+
icon: true,
|
|
166
|
+
iconName: 'mdi-chevron-right',
|
|
167
|
+
color: 'grey',
|
|
168
|
+
isVisible: `{{GridController_${this.grid.name}.isNotEditing}}`,
|
|
169
|
+
cssClass: `{{GridController_${this.grid.name}.toolbarClass}}`,
|
|
170
|
+
events: {
|
|
171
|
+
click: this.hideButtonClick.bind(this),
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: this.getAtomName('TOOLBAR_DIV'),
|
|
178
|
+
component: 'ZdTag',
|
|
179
|
+
tag: 'div',
|
|
180
|
+
cssStyle: 'display: flex; align-items: center',
|
|
181
|
+
isVisible: `{{GridController_${this.grid.name}.showToolbar}}`,
|
|
182
|
+
children: [
|
|
183
|
+
{
|
|
184
|
+
name: this.getAtomName('NOT_EDITING_SPAN'),
|
|
185
|
+
component: 'ZdTag',
|
|
186
|
+
tag: 'span',
|
|
187
|
+
cssStyle: 'display: flex',
|
|
188
|
+
isVisible: `{{GridController_${this.grid.name}.isNotEditing}}`,
|
|
189
|
+
children: [
|
|
190
|
+
{
|
|
191
|
+
name: this.getAtomName('ADD_TOOLTIP'),
|
|
192
|
+
component: 'ZdTooltip',
|
|
193
|
+
label: 'TEKGRID_ADD',
|
|
194
|
+
bottom: true,
|
|
195
|
+
children: [
|
|
196
|
+
{
|
|
197
|
+
name: this.getAtomName('ADD_BUTTON'),
|
|
198
|
+
component: 'ZdButton',
|
|
199
|
+
icon: true,
|
|
200
|
+
iconName: 'mdi-plus-box',
|
|
201
|
+
isVisible: `{{GridController_${this.grid.name}.showAddButton}}`,
|
|
202
|
+
events: {
|
|
203
|
+
click: this.addButtonClick.bind(this),
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: this.getAtomName('DELETE_TOOLTIP'),
|
|
210
|
+
component: 'ZdTooltip',
|
|
211
|
+
label: 'TEKGRID_DELETE',
|
|
212
|
+
bottom: true,
|
|
213
|
+
children: [
|
|
214
|
+
{
|
|
215
|
+
name: this.getAtomName('DELETE_BUTTON'),
|
|
216
|
+
component: 'ZdButton',
|
|
217
|
+
icon: true,
|
|
218
|
+
iconName: 'mdi-trash-can-outline',
|
|
219
|
+
isVisible: `{{GridController_${this.grid.name}.showDeleteButton}}`,
|
|
220
|
+
disabled: `{{GridController_${this.grid.name}.disableDeleteButton}}`,
|
|
221
|
+
events: {
|
|
222
|
+
click: this.deleteButtonClick.bind(this),
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: this.getAtomName('DIVIDER1'),
|
|
229
|
+
component: 'ZdDivider',
|
|
230
|
+
cssClass: 'toolbar-divider',
|
|
231
|
+
vertical: true,
|
|
232
|
+
isVisible: `{{GridController_${this.grid.name}.showDivider1}}`,
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: this.getAtomName('REFRESH_TOOLTIP'),
|
|
236
|
+
component: 'ZdTooltip',
|
|
237
|
+
label: 'TEKGRID_REFRESH',
|
|
238
|
+
bottom: true,
|
|
239
|
+
children: [
|
|
240
|
+
{
|
|
241
|
+
name: this.getAtomName('REFRESH_BUTTON'),
|
|
242
|
+
component: 'ZdButton',
|
|
243
|
+
icon: true,
|
|
244
|
+
iconName: 'refresh',
|
|
245
|
+
isVisible: `{{GridController_${this.grid.name}.showReloadButton}}`,
|
|
246
|
+
events: {
|
|
247
|
+
click: this.reloadGrid.bind(this),
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: this.getAtomName('DIVIDER2'),
|
|
254
|
+
component: 'ZdDivider',
|
|
255
|
+
cssClass: 'toolbar-divider',
|
|
256
|
+
vertical: true,
|
|
257
|
+
isVisible: `{{GridController_${this.grid.name}.showDivider2}}`,
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: this.getAtomName('COLUMNS_BUTTON'),
|
|
261
|
+
component: 'TekGridColumnsButton',
|
|
262
|
+
isVisible: `{{GridController_${this.grid.name}.showColumnsButton}}`,
|
|
263
|
+
iterableComponentName: this.grid.name,
|
|
264
|
+
hideGroups: this.groupsVisibility === 'hide',
|
|
265
|
+
ignoreColumns: `{{GridController_${this.grid.name}.columnsButtonIgnore}}`,
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: this.getAtomName('LAYOUT_BUTTON'),
|
|
269
|
+
component: 'TekGridLayoutOptions',
|
|
270
|
+
isVisible: `{{GridController_${this.grid.name}.showLayoutOptionsButton}}`,
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: this.getAtomName('DIVIDER_ACTIONS'),
|
|
274
|
+
component: 'ZdDivider',
|
|
275
|
+
cssClass: 'toolbar-divider',
|
|
276
|
+
vertical: true,
|
|
277
|
+
isVisible: `{{GridController_${this.grid.name}.showActionAndExportButton}}`,
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: this.getAtomName('EXPORT_DROPDOWN'),
|
|
281
|
+
component: 'ZdDropdown',
|
|
282
|
+
cssClass: 'tekgrid-actions-dropdown',
|
|
283
|
+
offsetY: true,
|
|
284
|
+
activator: {
|
|
285
|
+
name: this.getAtomName('EXPORT_BUTTON'),
|
|
286
|
+
component: 'ZdButton',
|
|
287
|
+
icon: true,
|
|
288
|
+
iconName: 'mdi-file-download-outline',
|
|
289
|
+
isVisible: `{{GridController_${this.grid.name}.showExportButton}}`,
|
|
290
|
+
},
|
|
291
|
+
children: this.grid.exportActions || exportConfigButtons,
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: this.getAtomName('ACTIONS_DROPDOWN'),
|
|
295
|
+
component: 'ZdDropdown',
|
|
296
|
+
cssClass: 'tekgrid-actions-dropdown',
|
|
297
|
+
offsetY: true,
|
|
298
|
+
activator: {
|
|
299
|
+
name: this.getAtomName('ACTIONS_BUTTON'),
|
|
300
|
+
component: 'ZdButton',
|
|
301
|
+
icon: true,
|
|
302
|
+
iconName: 'mdi-dots-vertical',
|
|
303
|
+
isVisible: `{{GridController_${this.grid.name}.showActionsButton}}`,
|
|
304
|
+
},
|
|
305
|
+
children: this.grid.actions,
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: this.getAtomName('DIVIDER3'),
|
|
309
|
+
component: 'ZdDivider',
|
|
310
|
+
cssClass: 'toolbar-divider',
|
|
311
|
+
vertical: true,
|
|
312
|
+
isVisible: `{{GridController_${this.grid.name}.showDivider3}}`,
|
|
313
|
+
},
|
|
314
|
+
],
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: this.getAtomName('SAVE_BUTTON'),
|
|
318
|
+
component: 'ZdButton',
|
|
319
|
+
label: 'TEKGRID_SAVE',
|
|
320
|
+
isVisible: `{{GridController_${this.grid.name}.showEditButtons}}`,
|
|
321
|
+
small: true,
|
|
322
|
+
events: {
|
|
323
|
+
click: this.saveChanges.bind(this),
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: this.getAtomName('CANCEL_BUTTON'),
|
|
328
|
+
component: 'ZdButton',
|
|
329
|
+
label: 'TEKGRID_CANCEL',
|
|
330
|
+
outline: true,
|
|
331
|
+
cssClass: 'zd-mx-2',
|
|
332
|
+
isVisible: `{{GridController_${this.grid.name}.showEditButtons}}`,
|
|
333
|
+
small: true,
|
|
334
|
+
events: {
|
|
335
|
+
click: this.cancelChanges.bind(this),
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: this.getAtomName('SEARCH'),
|
|
340
|
+
component: 'ZdSearch',
|
|
341
|
+
cssClass: 'zd-grid-search',
|
|
342
|
+
iterableComponentName: `${this.grid.name}`,
|
|
343
|
+
isVisible: `{{GridController_${this.grid.name}.showSearchInput}}`,
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: this.getAtomName('FILTER_TOOLTIP'),
|
|
347
|
+
component: 'ZdTooltip',
|
|
348
|
+
label: 'TEKGRID_FILTER',
|
|
349
|
+
bottom: true,
|
|
350
|
+
children: [
|
|
351
|
+
{
|
|
352
|
+
name: this.getAtomName('FILTER_BUTTON'),
|
|
353
|
+
component: 'TekGridFilterButton',
|
|
354
|
+
grid: this.grid,
|
|
355
|
+
gridName: this.grid.name,
|
|
356
|
+
showCheckboxAll: this.grid.showCheckboxAllFilter,
|
|
357
|
+
isVisible: `{{GridController_${this.grid.name}.showFilterButton}}`,
|
|
358
|
+
},
|
|
359
|
+
],
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
},
|
|
363
|
+
];
|
|
364
|
+
}
|
|
365
|
+
}
|