@zeedhi/teknisa-components-common 1.99.0 → 1.100.1
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/coverage/clover.xml +397 -389
- package/coverage/coverage-final.json +7 -7
- package/coverage/lcov-report/index.html +9 -9
- package/coverage/lcov-report/tests/__helpers__/component-event-helper.ts.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/flush-promises-helper.ts.html +2 -2
- package/coverage/lcov-report/tests/__helpers__/get-child-helper.ts.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/index.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/index.ts.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/mock-created-helper.ts.html +1 -1
- package/coverage/lcov.info +689 -675
- package/dist/tek-components-common.esm.js +30 -3
- package/dist/tek-components-common.umd.js +30 -3
- package/package.json +2 -2
- package/tests/unit/components/tek-grid/grid.spec.ts +151 -0
- package/types/components/tek-grid/grid.d.ts +3 -0
- package/types/components/tek-grid/interfaces.d.ts +1 -0
|
@@ -1293,7 +1293,7 @@ Messages.add({
|
|
|
1293
1293
|
TEKGRID_GRID_MIRROR: '(Grid mirror)',
|
|
1294
1294
|
},
|
|
1295
1295
|
},
|
|
1296
|
-
'es-
|
|
1296
|
+
'es-CL': {
|
|
1297
1297
|
translation: {
|
|
1298
1298
|
TEKGRID_CONTAINS: 'contiene',
|
|
1299
1299
|
TEKGRID_NOT_CONTAINS: 'no contiene',
|
|
@@ -2245,6 +2245,7 @@ class TekGrid extends GridEditable {
|
|
|
2245
2245
|
this.dragColumns = this.getInitValue('dragColumns', props.dragColumns, this.dragColumns);
|
|
2246
2246
|
this.resizeColumns = this.getInitValue('resizeColumns', props.resizeColumns, this.resizeColumns);
|
|
2247
2247
|
this.showLayoutOptions = this.getInitValue('showLayoutOptions', props.showLayoutOptions, this.showLayoutOptions);
|
|
2248
|
+
this.xlsDefaultType = this.getInitValue('xlsDefaultType', props.xlsDefaultType, this.xlsDefaultType);
|
|
2248
2249
|
this.showExport = this.getInitValue('showExport', props.showExport, this.showExport);
|
|
2249
2250
|
this.showReload = this.getInitValue('showReload', props.showReload, this.showReload);
|
|
2250
2251
|
this.exportConfig = this.getInitValue('exportConfig', props.exportConfig, this.exportConfig);
|
|
@@ -2431,6 +2432,7 @@ class TekGrid extends GridEditable {
|
|
|
2431
2432
|
filter,
|
|
2432
2433
|
groups: reportGroups,
|
|
2433
2434
|
columns: reportAggregations,
|
|
2435
|
+
xlsDefaultType: this.xlsDefaultType,
|
|
2434
2436
|
}),
|
|
2435
2437
|
}, beforeOpen)
|
|
2436
2438
|
.then((reportUrl) => window.open(reportUrl));
|
|
@@ -2818,6 +2820,19 @@ class TekGrid extends GridEditable {
|
|
|
2818
2820
|
}
|
|
2819
2821
|
this.preventRowClick = false;
|
|
2820
2822
|
}
|
|
2823
|
+
rowDoubleClick(row, event, element) {
|
|
2824
|
+
if (!this.preventRowDoubleClick) {
|
|
2825
|
+
this.datasource.currentRow = row;
|
|
2826
|
+
this.callEvent('rowDoubleClick', {
|
|
2827
|
+
event,
|
|
2828
|
+
element,
|
|
2829
|
+
row,
|
|
2830
|
+
component: this,
|
|
2831
|
+
column: undefined,
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
this.preventRowDoubleClick = false;
|
|
2835
|
+
}
|
|
2821
2836
|
/**
|
|
2822
2837
|
* Dispatches group row click event
|
|
2823
2838
|
* @param row Grid row
|
|
@@ -2836,6 +2851,18 @@ class TekGrid extends GridEditable {
|
|
|
2836
2851
|
}
|
|
2837
2852
|
this.preventRowClick = false;
|
|
2838
2853
|
}
|
|
2854
|
+
groupRowDoubleClick(row, event, element) {
|
|
2855
|
+
if (!this.preventRowDoubleClick) {
|
|
2856
|
+
this.callEvent('groupRowDoubleClick', {
|
|
2857
|
+
event,
|
|
2858
|
+
element,
|
|
2859
|
+
row,
|
|
2860
|
+
component: this,
|
|
2861
|
+
column: undefined,
|
|
2862
|
+
});
|
|
2863
|
+
}
|
|
2864
|
+
this.preventRowDoubleClick = false;
|
|
2865
|
+
}
|
|
2839
2866
|
/**
|
|
2840
2867
|
* Dispatches group select/unselect event
|
|
2841
2868
|
* @param row Group row
|
|
@@ -4128,7 +4155,7 @@ Messages.add({
|
|
|
4128
4155
|
TEKUSERINFO_SEND: 'Send',
|
|
4129
4156
|
},
|
|
4130
4157
|
},
|
|
4131
|
-
'es-
|
|
4158
|
+
'es-CL': {
|
|
4132
4159
|
translation: {
|
|
4133
4160
|
TEKUSERINFO_ABOUT: 'Sobre',
|
|
4134
4161
|
TEKUSERINFO_REPORT_ERROR: 'Reportar Error',
|
|
@@ -4308,7 +4335,7 @@ Messages.add({
|
|
|
4308
4335
|
DEFAULT_LAYOUT: 'Default',
|
|
4309
4336
|
},
|
|
4310
4337
|
},
|
|
4311
|
-
'es-
|
|
4338
|
+
'es-CL': {
|
|
4312
4339
|
translation: {
|
|
4313
4340
|
NO_NOTIFICATIONS: 'Sin Notificación',
|
|
4314
4341
|
MARK_ALL_AS_READ: 'Marcar todo como leído',
|
|
@@ -1297,7 +1297,7 @@
|
|
|
1297
1297
|
TEKGRID_GRID_MIRROR: '(Grid mirror)',
|
|
1298
1298
|
},
|
|
1299
1299
|
},
|
|
1300
|
-
'es-
|
|
1300
|
+
'es-CL': {
|
|
1301
1301
|
translation: {
|
|
1302
1302
|
TEKGRID_CONTAINS: 'contiene',
|
|
1303
1303
|
TEKGRID_NOT_CONTAINS: 'no contiene',
|
|
@@ -2249,6 +2249,7 @@
|
|
|
2249
2249
|
this.dragColumns = this.getInitValue('dragColumns', props.dragColumns, this.dragColumns);
|
|
2250
2250
|
this.resizeColumns = this.getInitValue('resizeColumns', props.resizeColumns, this.resizeColumns);
|
|
2251
2251
|
this.showLayoutOptions = this.getInitValue('showLayoutOptions', props.showLayoutOptions, this.showLayoutOptions);
|
|
2252
|
+
this.xlsDefaultType = this.getInitValue('xlsDefaultType', props.xlsDefaultType, this.xlsDefaultType);
|
|
2252
2253
|
this.showExport = this.getInitValue('showExport', props.showExport, this.showExport);
|
|
2253
2254
|
this.showReload = this.getInitValue('showReload', props.showReload, this.showReload);
|
|
2254
2255
|
this.exportConfig = this.getInitValue('exportConfig', props.exportConfig, this.exportConfig);
|
|
@@ -2435,6 +2436,7 @@
|
|
|
2435
2436
|
filter,
|
|
2436
2437
|
groups: reportGroups,
|
|
2437
2438
|
columns: reportAggregations,
|
|
2439
|
+
xlsDefaultType: this.xlsDefaultType,
|
|
2438
2440
|
}),
|
|
2439
2441
|
}, beforeOpen)
|
|
2440
2442
|
.then((reportUrl) => window.open(reportUrl));
|
|
@@ -2822,6 +2824,19 @@
|
|
|
2822
2824
|
}
|
|
2823
2825
|
this.preventRowClick = false;
|
|
2824
2826
|
}
|
|
2827
|
+
rowDoubleClick(row, event, element) {
|
|
2828
|
+
if (!this.preventRowDoubleClick) {
|
|
2829
|
+
this.datasource.currentRow = row;
|
|
2830
|
+
this.callEvent('rowDoubleClick', {
|
|
2831
|
+
event,
|
|
2832
|
+
element,
|
|
2833
|
+
row,
|
|
2834
|
+
component: this,
|
|
2835
|
+
column: undefined,
|
|
2836
|
+
});
|
|
2837
|
+
}
|
|
2838
|
+
this.preventRowDoubleClick = false;
|
|
2839
|
+
}
|
|
2825
2840
|
/**
|
|
2826
2841
|
* Dispatches group row click event
|
|
2827
2842
|
* @param row Grid row
|
|
@@ -2840,6 +2855,18 @@
|
|
|
2840
2855
|
}
|
|
2841
2856
|
this.preventRowClick = false;
|
|
2842
2857
|
}
|
|
2858
|
+
groupRowDoubleClick(row, event, element) {
|
|
2859
|
+
if (!this.preventRowDoubleClick) {
|
|
2860
|
+
this.callEvent('groupRowDoubleClick', {
|
|
2861
|
+
event,
|
|
2862
|
+
element,
|
|
2863
|
+
row,
|
|
2864
|
+
component: this,
|
|
2865
|
+
column: undefined,
|
|
2866
|
+
});
|
|
2867
|
+
}
|
|
2868
|
+
this.preventRowDoubleClick = false;
|
|
2869
|
+
}
|
|
2843
2870
|
/**
|
|
2844
2871
|
* Dispatches group select/unselect event
|
|
2845
2872
|
* @param row Group row
|
|
@@ -4132,7 +4159,7 @@
|
|
|
4132
4159
|
TEKUSERINFO_SEND: 'Send',
|
|
4133
4160
|
},
|
|
4134
4161
|
},
|
|
4135
|
-
'es-
|
|
4162
|
+
'es-CL': {
|
|
4136
4163
|
translation: {
|
|
4137
4164
|
TEKUSERINFO_ABOUT: 'Sobre',
|
|
4138
4165
|
TEKUSERINFO_REPORT_ERROR: 'Reportar Error',
|
|
@@ -4312,7 +4339,7 @@
|
|
|
4312
4339
|
DEFAULT_LAYOUT: 'Default',
|
|
4313
4340
|
},
|
|
4314
4341
|
},
|
|
4315
|
-
'es-
|
|
4342
|
+
'es-CL': {
|
|
4316
4343
|
translation: {
|
|
4317
4344
|
NO_NOTIFICATIONS: 'Sin Notificación',
|
|
4318
4345
|
MARK_ALL_AS_READ: 'Marcar todo como leído',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/teknisa-components-common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.100.1",
|
|
4
4
|
"description": "Teknisa Components Common",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@zeedhi/core": "~1.97.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "ab5303595a8ea77628401599164a96f9fd24dc77"
|
|
36
36
|
}
|
|
@@ -2034,6 +2034,79 @@ describe('TekGrid', () => {
|
|
|
2034
2034
|
});
|
|
2035
2035
|
});
|
|
2036
2036
|
|
|
2037
|
+
describe('rowDoubleClick', () => {
|
|
2038
|
+
it('rowDoubleClick method should call events.rowDoubleClick', () => {
|
|
2039
|
+
const rowDoubleClick = jest.fn();
|
|
2040
|
+
|
|
2041
|
+
const data = [
|
|
2042
|
+
{ id: '1', name: 'First' },
|
|
2043
|
+
{ id: '2', name: 'Second' },
|
|
2044
|
+
{ id: '3', name: 'Third' },
|
|
2045
|
+
];
|
|
2046
|
+
const grid = new TekGrid({
|
|
2047
|
+
name: 'grid',
|
|
2048
|
+
component: 'TekGrid',
|
|
2049
|
+
columns: [
|
|
2050
|
+
{ name: 'id' },
|
|
2051
|
+
{ name: 'name' },
|
|
2052
|
+
],
|
|
2053
|
+
datasource: {
|
|
2054
|
+
data,
|
|
2055
|
+
},
|
|
2056
|
+
events: {
|
|
2057
|
+
rowDoubleClick,
|
|
2058
|
+
},
|
|
2059
|
+
});
|
|
2060
|
+
|
|
2061
|
+
const event = new Event('dblclick');
|
|
2062
|
+
const element = document.createElement('div');
|
|
2063
|
+
grid.rowDoubleClick(data[0], event, element);
|
|
2064
|
+
|
|
2065
|
+
expect(rowDoubleClick).toHaveBeenCalledWith({
|
|
2066
|
+
event,
|
|
2067
|
+
element,
|
|
2068
|
+
row: data[0],
|
|
2069
|
+
component: grid,
|
|
2070
|
+
});
|
|
2071
|
+
expect(grid.datasource.currentRow).toEqual(data[0]);
|
|
2072
|
+
});
|
|
2073
|
+
|
|
2074
|
+
it('should not call events.rowDoubleClick if preventRowDoubleClick is true', () => {
|
|
2075
|
+
const rowDoubleClick = jest.fn();
|
|
2076
|
+
const cellDoubleClickHandler = jest.fn(() => true);
|
|
2077
|
+
|
|
2078
|
+
const data = [
|
|
2079
|
+
{ id: '1', name: 'First' },
|
|
2080
|
+
{ id: '2', name: 'Second' },
|
|
2081
|
+
{ id: '3', name: 'Third' },
|
|
2082
|
+
];
|
|
2083
|
+
const grid = new TekGrid({
|
|
2084
|
+
name: 'grid',
|
|
2085
|
+
component: 'TekGrid',
|
|
2086
|
+
columns: [
|
|
2087
|
+
{ name: 'id' },
|
|
2088
|
+
{ name: 'name' },
|
|
2089
|
+
],
|
|
2090
|
+
datasource: {
|
|
2091
|
+
data,
|
|
2092
|
+
},
|
|
2093
|
+
events: {
|
|
2094
|
+
rowDoubleClick,
|
|
2095
|
+
cellDoubleClick: cellDoubleClickHandler,
|
|
2096
|
+
},
|
|
2097
|
+
});
|
|
2098
|
+
|
|
2099
|
+
const event = new Event('dblclick');
|
|
2100
|
+
const element = document.createElement('div');
|
|
2101
|
+
|
|
2102
|
+
grid.cellDoubleClick(grid.groupedData[0], grid.getColumn('id') as any, event, element);
|
|
2103
|
+
grid.rowDoubleClick(data[0], event, element);
|
|
2104
|
+
|
|
2105
|
+
expect(rowDoubleClick).not.toHaveBeenCalled();
|
|
2106
|
+
expect(grid.datasource.currentRow).toEqual({});
|
|
2107
|
+
});
|
|
2108
|
+
});
|
|
2109
|
+
|
|
2037
2110
|
describe('groupRowClick', () => {
|
|
2038
2111
|
it('groupRowClick method should call events.groupRowClick', async () => {
|
|
2039
2112
|
const groupRowClick = jest.fn();
|
|
@@ -2109,6 +2182,84 @@ describe('TekGrid', () => {
|
|
|
2109
2182
|
});
|
|
2110
2183
|
});
|
|
2111
2184
|
|
|
2185
|
+
describe('groupRowDoubleClick', () => {
|
|
2186
|
+
it('groupRowDoubleClick method should call events.groupRowDoubleClick', async () => {
|
|
2187
|
+
const groupRowDoubleClick = jest.fn();
|
|
2188
|
+
|
|
2189
|
+
const data = [
|
|
2190
|
+
{ id: '1', name: 'First', department: 1 },
|
|
2191
|
+
{ id: '2', name: 'Second', department: 1 },
|
|
2192
|
+
{ id: '3', name: 'Third', department: 1 },
|
|
2193
|
+
];
|
|
2194
|
+
const grid = new TekGrid({
|
|
2195
|
+
name: 'grid',
|
|
2196
|
+
component: 'TekGrid',
|
|
2197
|
+
columns: [
|
|
2198
|
+
{ name: 'id' },
|
|
2199
|
+
{ name: 'name' },
|
|
2200
|
+
{ name: 'department', grouped: true },
|
|
2201
|
+
],
|
|
2202
|
+
datasource: {
|
|
2203
|
+
data,
|
|
2204
|
+
},
|
|
2205
|
+
events: {
|
|
2206
|
+
groupRowDoubleClick,
|
|
2207
|
+
},
|
|
2208
|
+
});
|
|
2209
|
+
|
|
2210
|
+
await flushPromises();
|
|
2211
|
+
|
|
2212
|
+
const event = new Event('dblclick');
|
|
2213
|
+
const element = document.createElement('div');
|
|
2214
|
+
grid.groupRowDoubleClick(grid.groupedData[0], event, element);
|
|
2215
|
+
|
|
2216
|
+
expect(groupRowDoubleClick).toHaveBeenCalledWith({
|
|
2217
|
+
event,
|
|
2218
|
+
element,
|
|
2219
|
+
row: grid.groupedData[0],
|
|
2220
|
+
component: grid,
|
|
2221
|
+
});
|
|
2222
|
+
expect(grid.datasource.currentRow).toEqual({});
|
|
2223
|
+
});
|
|
2224
|
+
|
|
2225
|
+
it('should not call events.groupRowDoubleClick if cellDoubleClick prevents it', async () => {
|
|
2226
|
+
const groupRowDoubleClick = jest.fn();
|
|
2227
|
+
const cellDoubleClickHandler = jest.fn(() => true);
|
|
2228
|
+
|
|
2229
|
+
const data = [
|
|
2230
|
+
{ id: '1', name: 'First', department: 1 },
|
|
2231
|
+
{ id: '2', name: 'Second', department: 1 },
|
|
2232
|
+
{ id: '3', name: 'Third', department: 1 },
|
|
2233
|
+
];
|
|
2234
|
+
const grid = new TekGrid({
|
|
2235
|
+
name: 'grid',
|
|
2236
|
+
component: 'TekGrid',
|
|
2237
|
+
columns: [
|
|
2238
|
+
{ name: 'id' },
|
|
2239
|
+
{ name: 'name' },
|
|
2240
|
+
{ name: 'department', grouped: true },
|
|
2241
|
+
],
|
|
2242
|
+
datasource: {
|
|
2243
|
+
data,
|
|
2244
|
+
},
|
|
2245
|
+
events: {
|
|
2246
|
+
groupRowDoubleClick,
|
|
2247
|
+
cellDoubleClick: cellDoubleClickHandler,
|
|
2248
|
+
},
|
|
2249
|
+
});
|
|
2250
|
+
|
|
2251
|
+
await flushPromises();
|
|
2252
|
+
|
|
2253
|
+
const event = new Event('dblclick');
|
|
2254
|
+
const element = document.createElement('div');
|
|
2255
|
+
|
|
2256
|
+
grid.cellDoubleClick(grid.groupedData[0], grid.getColumn('id') as any, event, element);
|
|
2257
|
+
grid.groupRowDoubleClick(grid.groupedData[0], event, element);
|
|
2258
|
+
|
|
2259
|
+
expect(groupRowDoubleClick).not.toHaveBeenCalled();
|
|
2260
|
+
});
|
|
2261
|
+
});
|
|
2262
|
+
|
|
2112
2263
|
describe('selectGroupClick', () => {
|
|
2113
2264
|
it('should trigger events', async () => {
|
|
2114
2265
|
const groupSelected = jest.fn();
|
|
@@ -32,6 +32,7 @@ export declare class TekGrid extends GridEditable implements ITekGrid {
|
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
34
|
showLayoutOptions: boolean;
|
|
35
|
+
xlsDefaultType?: string;
|
|
35
36
|
/**
|
|
36
37
|
* Editable columns
|
|
37
38
|
*/
|
|
@@ -150,6 +151,7 @@ export declare class TekGrid extends GridEditable implements ITekGrid {
|
|
|
150
151
|
* @param element DOM Element
|
|
151
152
|
*/
|
|
152
153
|
rowClick(row: IDictionary<any>, event: Event, element: HTMLElement): void;
|
|
154
|
+
rowDoubleClick(row: IDictionary<any>, event: Event, element: HTMLElement): void;
|
|
153
155
|
/**
|
|
154
156
|
* Dispatches group row click event
|
|
155
157
|
* @param row Grid row
|
|
@@ -157,6 +159,7 @@ export declare class TekGrid extends GridEditable implements ITekGrid {
|
|
|
157
159
|
* @param element DOM Element
|
|
158
160
|
*/
|
|
159
161
|
groupRowClick(row: IDictionary<any>, event: Event, element: HTMLElement): void;
|
|
162
|
+
groupRowDoubleClick(row: IDictionary<any>, event: Event, element: HTMLElement): void;
|
|
160
163
|
/**
|
|
161
164
|
* Dispatches group select/unselect event
|
|
162
165
|
* @param row Group row
|