@progress/kendo-vue-grid 3.7.2-dev.202211010734 → 3.7.3-dev.202211021251

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/es/Grid.js CHANGED
@@ -51,13 +51,14 @@ import { FilterRow } from './header/FilterRow';
51
51
  import { GroupPanel } from './header/GroupPanel';
52
52
  import { Footer } from './footer/Footer';
53
53
  import { FooterRow } from './footer/FooterRow';
54
+ import { GridCellValue } from './GridCellValue';
54
55
  import { operators } from './filterCommon';
55
56
  import { VirtualScroll } from './VirtualScroll';
56
57
  import { ColumnResize } from './drag/ColumnResize';
57
58
  import { CommonDragLogic } from './drag/CommonDragLogic';
58
59
  import { DragClue } from './drag/DragClue';
59
60
  import { DropClue } from './drag/DropClue';
60
- import { getNestedValue, flatData, mapColumns, readColumns, autoGenerateColumns, applyExpandedState, groupedFirstItemValue } from './utils/main';
61
+ import { flatData, mapColumns, readColumns, autoGenerateColumns, applyExpandedState, groupedFirstItemValue } from './utils/main';
61
62
  import { GridCell } from './cells/GridCell';
62
63
  import { GridGroupCell } from './cells/GridGroupCell';
63
64
  import { GridRow } from './rows/GridRow';
@@ -1149,8 +1150,6 @@ var GridVue2 = {
1149
1150
  colSpans = _a.colSpans,
1150
1151
  isColHidden = _a.hiddenColumns;
1151
1152
  var dataRow = function dataRow(item, rowId, rowDataIndex) {
1152
- var isInEdit = false;
1153
- var selectedValue = this.$props.selectedField ? getNestedValue(this.$props.selectedField, item.dataItem) : undefined;
1154
1153
  return {
1155
1154
  row: this._columns.map(function (column, index) {
1156
1155
  var _this = this;
@@ -1165,14 +1164,6 @@ var GridVue2 = {
1165
1164
  left: column.right + 'px',
1166
1165
  right: column.left + 'px'
1167
1166
  } : {};
1168
- var currentColumnIsInEdit = false;
1169
- if (column.editable && this.$props.editField) {
1170
- var inEdit = getNestedValue(this.$props.editField, item.dataItem);
1171
- if (inEdit === true || inEdit === column.field) {
1172
- isInEdit = true;
1173
- currentColumnIsInEdit = true;
1174
- }
1175
- }
1176
1167
  var columnCellRenderFunction;
1177
1168
  if (column.cell) {
1178
1169
  columnCellRenderFunction = templateRendering.call(this, column.cell, getListeners.call(this));
@@ -1204,8 +1195,7 @@ var GridVue2 = {
1204
1195
  level: item.level,
1205
1196
  expanded: isExpanded,
1206
1197
  dataIndex: item.dataIndex,
1207
- ariaColumnIndex: column.ariaColumnIndex,
1208
- isSelected: Array.isArray(selectedValue) && selectedValue.indexOf(index) > -1
1198
+ ariaColumnIndex: column.ariaColumnIndex
1209
1199
  },
1210
1200
  colSpan: colSpans[index],
1211
1201
  dataItem: item.dataItem,
@@ -1245,20 +1235,156 @@ var GridVue2 = {
1245
1235
  expanded: isExpanded,
1246
1236
  dataIndex: item.dataIndex,
1247
1237
  style: style,
1248
- ariaColumnIndex: column.ariaColumnIndex,
1249
- isSelected: Array.isArray(selectedValue) && selectedValue.indexOf(index) > -1
1238
+ ariaColumnIndex: column.ariaColumnIndex
1250
1239
  });
1251
1240
  }
1252
- if (currentColumnIsInEdit) {
1253
- // @ts-ignore
1254
- return h(GridEditCell, {
1241
+ // @ts-ignore
1242
+ return h(GridCellValue, {
1243
+ dataItem: item.dataItem,
1244
+ attrs: this.v3 ? undefined : {
1245
+ dataItem: item.dataItem,
1246
+ editField: this.$props.editField,
1247
+ column: column,
1248
+ editCell: h(GridEditCell, {
1249
+ id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1250
+ attrs: this.v3 ? undefined : {
1251
+ id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1252
+ colSpan: colSpans[index],
1253
+ dataItem: item.dataItem,
1254
+ field: column.field || '' // todo
1255
+ ,
1256
+ editor: column.editor,
1257
+ format: column.format,
1258
+ readFormat: column.readFormat,
1259
+ type: column.type,
1260
+ className: className,
1261
+ render: columnCellRenderFunction || cellRenderFunction,
1262
+ columnIndex: index,
1263
+ columnsCount: this._columns.filter(function (c) {
1264
+ return !c.children.length;
1265
+ }).length,
1266
+ rowType: item.rowType,
1267
+ level: item.level,
1268
+ expanded: isExpanded,
1269
+ dataIndex: item.dataIndex
1270
+ },
1271
+ key: index,
1272
+ colSpan: colSpans[index],
1273
+ dataItem: item.dataItem,
1274
+ field: column.field || '',
1275
+ editor: column.editor,
1276
+ format: column.format,
1277
+ readFormat: column.readFormat,
1278
+ type: column.type,
1279
+ className: className,
1280
+ render: columnCellRenderFunction || cellRenderFunction,
1281
+ onEdit: this.editHandler,
1282
+ on: this.v3 ? undefined : {
1283
+ "edit": this.editHandler,
1284
+ "remove": this.removeHandler,
1285
+ "save": this.saveHandler,
1286
+ "cancel": this.cancelHandler,
1287
+ "change": this.itemChange
1288
+ },
1289
+ onRemove: this.removeHandler,
1290
+ onSave: this.saveHandler,
1291
+ onCancel: this.cancelHandler,
1292
+ onChange: this.itemChange,
1293
+ columnIndex: index,
1294
+ columnsCount: this._columns.filter(function (c) {
1295
+ return !c.children.length;
1296
+ }).length,
1297
+ rowType: item.rowType,
1298
+ level: item.level,
1299
+ expanded: isExpanded,
1300
+ dataIndex: item.dataIndex,
1301
+ style: style
1302
+ }),
1303
+ inbuildCell: h(GridCell, {
1304
+ key: index,
1305
+ id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1306
+ attrs: this.v3 ? undefined : {
1307
+ id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1308
+ colSpan: colSpans[index],
1309
+ dataItem: item.dataItem,
1310
+ field: column.field || '' // todo
1311
+ ,
1312
+ editor: column.editor,
1313
+ format: column.format,
1314
+ readFormat: column.readFormat,
1315
+ type: column.type,
1316
+ className: className,
1317
+ render: columnCellRenderFunction || cellRenderFunction,
1318
+ columnIndex: index,
1319
+ columnsCount: this._columns.filter(function (c) {
1320
+ return !c.children.length;
1321
+ }).length,
1322
+ rowType: item.rowType,
1323
+ level: item.level,
1324
+ expanded: isExpanded,
1325
+ dataIndex: item.dataIndex
1326
+ },
1327
+ colSpan: colSpans[index],
1328
+ dataItem: item.dataItem,
1329
+ field: column.field || '',
1330
+ editor: column.editor,
1331
+ format: column.format,
1332
+ readFormat: column.readFormat,
1333
+ type: column.type,
1334
+ className: className,
1335
+ render: columnCellRenderFunction || cellRenderFunction,
1336
+ onCellclick: this.cellClickHandler,
1337
+ on: this.v3 ? undefined : {
1338
+ "cellclick": this.cellClickHandler,
1339
+ "cellkeydown": this.cellKeydownHandler,
1340
+ "edit": this.editHandler,
1341
+ "remove": this.removeHandler,
1342
+ "save": this.saveHandler,
1343
+ "cancel": this.cancelHandler,
1344
+ "change": this.itemChange,
1345
+ "selectionchange": function selectionchange(e) {
1346
+ return _this.selectionChangeHandler({
1347
+ event: e,
1348
+ dataItem: item.dataItem,
1349
+ dataIndex: rowDataIndex,
1350
+ columnIndex: index
1351
+ });
1352
+ }
1353
+ },
1354
+ onCellkeydown: this.cellKeydownHandler,
1355
+ onEdit: this.editHandler,
1356
+ onRemove: this.removeHandler,
1357
+ onSave: this.saveHandler,
1358
+ onCancel: this.cancelHandler,
1359
+ onChange: this.itemChange,
1360
+ onSelectionchange: function selectionchange(e) {
1361
+ return _this.selectionChangeHandler({
1362
+ event: e,
1363
+ dataItem: item.dataItem,
1364
+ dataIndex: rowDataIndex,
1365
+ columnIndex: index
1366
+ });
1367
+ },
1368
+ columnIndex: index,
1369
+ columnsCount: this._columns.filter(function (c) {
1370
+ return !c.children.length;
1371
+ }).length,
1372
+ rowType: item.rowType,
1373
+ level: item.level,
1374
+ expanded: isExpanded,
1375
+ dataIndex: item.dataIndex,
1376
+ style: style
1377
+ })
1378
+ },
1379
+ editField: this.$props.editField,
1380
+ column: column,
1381
+ editCell: h(GridEditCell, {
1255
1382
  id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1256
1383
  attrs: this.v3 ? undefined : {
1257
1384
  id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1258
1385
  colSpan: colSpans[index],
1259
1386
  dataItem: item.dataItem,
1260
- field: column.field || '' // todo
1261
- ,
1387
+ field: column.field || '',
1262
1388
  editor: column.editor,
1263
1389
  format: column.format,
1264
1390
  readFormat: column.readFormat,
@@ -1305,24 +1431,71 @@ var GridVue2 = {
1305
1431
  expanded: isExpanded,
1306
1432
  dataIndex: item.dataIndex,
1307
1433
  style: style
1308
- });
1309
- }
1310
- // @ts-ignore
1311
- var inbuiltSlot = h(GridCell, {
1312
- key: index,
1313
- id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1314
- attrs: this.v3 ? undefined : {
1434
+ }),
1435
+ inbuildCell: h(GridCell, {
1436
+ key: index,
1315
1437
  id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1438
+ attrs: this.v3 ? undefined : {
1439
+ id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1440
+ colSpan: colSpans[index],
1441
+ dataItem: item.dataItem,
1442
+ field: column.field || '',
1443
+ editor: column.editor,
1444
+ format: column.format,
1445
+ readFormat: column.readFormat,
1446
+ type: column.type,
1447
+ className: className,
1448
+ render: columnCellRenderFunction || cellRenderFunction,
1449
+ columnIndex: index,
1450
+ columnsCount: this._columns.filter(function (c) {
1451
+ return !c.children.length;
1452
+ }).length,
1453
+ rowType: item.rowType,
1454
+ level: item.level,
1455
+ expanded: isExpanded,
1456
+ dataIndex: item.dataIndex
1457
+ },
1316
1458
  colSpan: colSpans[index],
1317
1459
  dataItem: item.dataItem,
1318
- field: column.field || '' // todo
1319
- ,
1460
+ field: column.field || '',
1320
1461
  editor: column.editor,
1321
1462
  format: column.format,
1322
1463
  readFormat: column.readFormat,
1323
1464
  type: column.type,
1324
1465
  className: className,
1325
1466
  render: columnCellRenderFunction || cellRenderFunction,
1467
+ onCellclick: this.cellClickHandler,
1468
+ on: this.v3 ? undefined : {
1469
+ "cellclick": this.cellClickHandler,
1470
+ "cellkeydown": this.cellKeydownHandler,
1471
+ "edit": this.editHandler,
1472
+ "remove": this.removeHandler,
1473
+ "save": this.saveHandler,
1474
+ "cancel": this.cancelHandler,
1475
+ "change": this.itemChange,
1476
+ "selectionchange": function selectionchange(e) {
1477
+ return _this.selectionChangeHandler({
1478
+ event: e,
1479
+ dataItem: item.dataItem,
1480
+ dataIndex: rowDataIndex,
1481
+ columnIndex: index
1482
+ });
1483
+ }
1484
+ },
1485
+ onCellkeydown: this.cellKeydownHandler,
1486
+ onEdit: this.editHandler,
1487
+ onRemove: this.removeHandler,
1488
+ onSave: this.saveHandler,
1489
+ onCancel: this.cancelHandler,
1490
+ onChange: this.itemChange,
1491
+ onSelectionchange: function selectionchange(e) {
1492
+ return _this.selectionChangeHandler({
1493
+ event: e,
1494
+ dataItem: item.dataItem,
1495
+ dataIndex: rowDataIndex,
1496
+ columnIndex: index
1497
+ });
1498
+ },
1326
1499
  columnIndex: index,
1327
1500
  columnsCount: this._columns.filter(function (c) {
1328
1501
  return !c.children.length;
@@ -1330,63 +1503,11 @@ var GridVue2 = {
1330
1503
  rowType: item.rowType,
1331
1504
  level: item.level,
1332
1505
  expanded: isExpanded,
1333
- dataIndex: item.dataIndex
1334
- },
1335
- colSpan: colSpans[index],
1336
- dataItem: item.dataItem,
1337
- field: column.field || '',
1338
- editor: column.editor,
1339
- format: column.format,
1340
- readFormat: column.readFormat,
1341
- type: column.type,
1342
- className: className,
1343
- render: columnCellRenderFunction || cellRenderFunction,
1344
- onCellclick: this.cellClickHandler,
1345
- on: this.v3 ? undefined : {
1346
- "cellclick": this.cellClickHandler,
1347
- "cellkeydown": this.cellKeydownHandler,
1348
- "edit": this.editHandler,
1349
- "remove": this.removeHandler,
1350
- "save": this.saveHandler,
1351
- "cancel": this.cancelHandler,
1352
- "change": this.itemChange,
1353
- "selectionchange": function selectionchange(e) {
1354
- return _this.selectionChangeHandler({
1355
- event: e,
1356
- dataItem: item.dataItem,
1357
- dataIndex: rowDataIndex,
1358
- columnIndex: index
1359
- });
1360
- }
1361
- },
1362
- onCellkeydown: this.cellKeydownHandler,
1363
- onEdit: this.editHandler,
1364
- onRemove: this.removeHandler,
1365
- onSave: this.saveHandler,
1366
- onCancel: this.cancelHandler,
1367
- onChange: this.itemChange,
1368
- onSelectionchange: function selectionchange(e) {
1369
- return _this.selectionChangeHandler({
1370
- event: e,
1371
- dataItem: item.dataItem,
1372
- dataIndex: rowDataIndex,
1373
- columnIndex: index
1374
- });
1375
- },
1376
- columnIndex: index,
1377
- columnsCount: this._columns.filter(function (c) {
1378
- return !c.children.length;
1379
- }).length,
1380
- rowType: item.rowType,
1381
- level: item.level,
1382
- expanded: isExpanded,
1383
- dataIndex: item.dataIndex,
1384
- style: style
1506
+ dataIndex: item.dataIndex,
1507
+ style: style
1508
+ })
1385
1509
  });
1386
- return inbuiltSlot;
1387
- }, this),
1388
- isInEdit: isInEdit,
1389
- isSelected: typeof selectedValue === 'boolean' && selectedValue
1510
+ }, this)
1390
1511
  };
1391
1512
  };
1392
1513
  var hiddenRows = 0;
@@ -1446,18 +1567,15 @@ var GridVue2 = {
1446
1567
  attrs: this.v3 ? undefined : {
1447
1568
  dataItem: item.dataItem,
1448
1569
  isAltRow: isAlt,
1449
- isInEdit: dataRow.isInEdit,
1450
1570
  rowType: item.rowType,
1451
1571
  isHidden: hidden(rowIndex),
1452
1572
  selectedField: this.$props.selectedField,
1453
1573
  rowHeight: this.$props.rowHeight,
1454
1574
  render: rowRenderFunction,
1455
1575
  ariaRowIndex: currentAriaRowIndex,
1456
- dataIndex: dataIndex,
1457
- isSelected: dataRow.isSelected
1576
+ dataIndex: dataIndex
1458
1577
  },
1459
1578
  isAltRow: isAlt,
1460
- isInEdit: dataRow.isInEdit,
1461
1579
  rowType: item.rowType,
1462
1580
  isHidden: hidden(rowIndex),
1463
1581
  onRowclick: function onRowclick(e) {
@@ -1479,7 +1597,6 @@ var GridVue2 = {
1479
1597
  render: rowRenderFunction,
1480
1598
  ariaRowIndex: currentAriaRowIndex,
1481
1599
  dataIndex: dataIndex,
1482
- isSelected: dataRow.isSelected,
1483
1600
  "class": this.$props.rowClass ? this.$props.rowClass(item) : ''
1484
1601
  }, this.v3 ? function () {
1485
1602
  return [dataRow.call(_this2, item, rowId, dataIndex).row];
@@ -0,0 +1,21 @@
1
+ declare type DefaultData<V> = object | ((this: V) => {});
2
+ declare type DefaultMethods<V> = {
3
+ [key: string]: (this: V, ...args: any[]) => any;
4
+ };
5
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from './additionalTypes';
6
+ interface GridCellValueProps {
7
+ dataItem: object;
8
+ column: object;
9
+ editCell: object;
10
+ inbuildCell: object;
11
+ editField?: string;
12
+ }
13
+ /**
14
+ * @hidden
15
+ */
16
+ declare let GridCellValueVue2: ComponentOptions<Vue2type, DefaultData<{}>, DefaultMethods<{}>, {}, RecordPropsDefinition<GridCellValueProps>>;
17
+ /**
18
+ * @hidden
19
+ */
20
+ declare const GridCellValue: DefineComponent<GridCellValueProps, any, {}, {}, {}, {}, {}, {}, string, GridCellValueProps, GridCellValueProps, {}>;
21
+ export { GridCellValue, GridCellValueVue2 };
@@ -0,0 +1,37 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ var isV3 = allVue.version && allVue.version[0] === '3';
6
+ import { getNestedValue } from '@progress/kendo-vue-common';
7
+ /**
8
+ * @hidden
9
+ */
10
+ var GridCellValueVue2 = {
11
+ name: 'GridCellValue',
12
+ props: {
13
+ dataItem: Object,
14
+ column: Object,
15
+ editField: String,
16
+ editCell: Object,
17
+ inbuildCell: Object
18
+ },
19
+ // @ts-ignore
20
+ setup: !isV3 ? undefined : function () {
21
+ var v3 = !!isV3;
22
+ return {
23
+ v3: v3
24
+ };
25
+ },
26
+ // @ts-ignore
27
+ render: function render(createElement) {
28
+ var h = gh || createElement;
29
+ var inEdit = this.editField ? getNestedValue(this.editField, this.dataItem) : false;
30
+ return this.column.editable && this.editField && (inEdit === true || inEdit === this.column.field) ? this.editCell : this.inbuildCell;
31
+ }
32
+ };
33
+ /**
34
+ * @hidden
35
+ */
36
+ var GridCellValue = GridCellValueVue2;
37
+ export { GridCellValue, GridCellValueVue2 };
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-vue-grid',
6
6
  productName: 'Kendo UI for Vue',
7
7
  productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
8
- publishDate: 1667287687,
8
+ publishDate: 1667393037,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
11
11
  };