@progress/kendo-vue-grid 4.3.3-dev.202404121101 → 4.3.3-dev.202404220722

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/esm/Grid.js CHANGED
@@ -36,7 +36,7 @@ var gh = allVue.h;
36
36
  var isV3 = allVue.version && allVue.version[0] === '3';
37
37
  var ref = allVue.ref;
38
38
  var markRaw = allVue.markRaw;
39
- import { templateRendering, hasListener, getListeners, getDefaultSlots, guid, getter, isRtl, validatePackage, getTemplate, shouldShowValidationUI, canUseDOM, templateDefinition, isObject, setRef, getRef, kendoThemeMaps, WatermarkOverlay } from '@progress/kendo-vue-common';
39
+ import { templateRendering, hasListener, getListeners, getDefaultSlots, guid, getter, isRtl, getNestedValue, validatePackage, getTemplate, shouldShowValidationUI, canUseDOM, templateDefinition, isObject, setRef, getRef, kendoThemeMaps, WatermarkOverlay } from '@progress/kendo-vue-common';
40
40
  import { tableColumnsVirtualization, Pager, normalize, tableKeyboardNavigationTools as navigationTools, TableKeyboardNavigationProvider } from '@progress/kendo-vue-data-tools';
41
41
  import { Loader } from '@progress/kendo-vue-indicators';
42
42
  import { GridNav } from './GridNav.js';
@@ -51,7 +51,6 @@ import { FilterRow } from './header/FilterRow.js';
51
51
  import { GroupPanel } from './header/GroupPanel.js';
52
52
  import { Footer } from './footer/Footer.js';
53
53
  import { FooterRow } from './footer/FooterRow.js';
54
- import { GridCellValue } from './GridCellValue.js';
55
54
  import { operators } from './filterCommon.js';
56
55
  import { VirtualScroll } from './VirtualScroll.js';
57
56
  import { RowHeightService, VirtualScrollFixed } from './VirtualScrollFixed.js';
@@ -1300,6 +1299,9 @@ var GridVue2 = {
1300
1299
  colSpans = _a.colSpans,
1301
1300
  isColHidden = _a.hiddenColumns;
1302
1301
  var dataRow = function dataRow(item, rowId, rowDataIndex) {
1302
+ var isInEdit = false;
1303
+ var selectedField = this.$props.selectedField;
1304
+ var selectedValue = selectedField ? getNestedValue(selectedField, item.dataItem) : undefined;
1303
1305
  return {
1304
1306
  row: this._columns.map(function (column, index) {
1305
1307
  var _this = this;
@@ -1314,6 +1316,14 @@ var GridVue2 = {
1314
1316
  left: column.right + 'px',
1315
1317
  right: column.left + 'px'
1316
1318
  } : {};
1319
+ var currentColumnIsInEdit = false;
1320
+ if (column.editable && this.$props.editField) {
1321
+ var inEdit = getNestedValue(this.$props.editField, item.dataItem);
1322
+ if (inEdit === true || inEdit === column.field) {
1323
+ isInEdit = true;
1324
+ currentColumnIsInEdit = true;
1325
+ }
1326
+ }
1317
1327
  var columnCellRenderFunction;
1318
1328
  if (column.cell) {
1319
1329
  columnCellRenderFunction = templateRendering.call(this, column.cell, getListeners.call(this));
@@ -1346,7 +1356,8 @@ var GridVue2 = {
1346
1356
  expanded: isExpanded,
1347
1357
  dataIndex: item.dataIndex,
1348
1358
  ariaColumnIndex: column.ariaColumnIndex,
1349
- isRtl: this.isRtl
1359
+ isRtl: this.isRtl,
1360
+ isSelected: Array.isArray(selectedValue) && selectedValue.indexOf(index) > -1
1350
1361
  },
1351
1362
  colSpan: colSpans[index],
1352
1363
  dataItem: item.dataItem,
@@ -1387,156 +1398,20 @@ var GridVue2 = {
1387
1398
  dataIndex: item.dataIndex,
1388
1399
  style: style,
1389
1400
  ariaColumnIndex: column.ariaColumnIndex,
1390
- isRtl: this.isRtl
1401
+ isRtl: this.isRtl,
1402
+ isSelected: Array.isArray(selectedValue) && selectedValue.indexOf(index) > -1
1391
1403
  });
1392
1404
  }
1393
- // @ts-ignore
1394
- return h(GridCellValue, {
1395
- dataItem: item.dataItem,
1396
- attrs: this.v3 ? undefined : {
1397
- dataItem: item.dataItem,
1398
- editField: this.$props.editField,
1399
- column: column,
1400
- editCell: h(GridEditCell, {
1401
- id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1402
- attrs: this.v3 ? undefined : {
1403
- id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1404
- colSpan: colSpans[index],
1405
- dataItem: item.dataItem,
1406
- field: column.field || '' // todo
1407
- ,
1408
- editor: column.editor,
1409
- format: column.format,
1410
- readFormat: column.readFormat,
1411
- type: column.type,
1412
- className: className,
1413
- render: columnCellRenderFunction || cellRenderFunction,
1414
- columnIndex: index,
1415
- columnsCount: this._columns.filter(function (c) {
1416
- return !c.children.length;
1417
- }).length,
1418
- rowType: item.rowType,
1419
- level: item.level,
1420
- expanded: isExpanded,
1421
- dataIndex: item.dataIndex
1422
- },
1423
- key: index,
1424
- colSpan: colSpans[index],
1425
- dataItem: item.dataItem,
1426
- field: column.field || '',
1427
- editor: column.editor,
1428
- format: column.format,
1429
- readFormat: column.readFormat,
1430
- type: column.type,
1431
- className: className,
1432
- render: columnCellRenderFunction || cellRenderFunction,
1433
- onEdit: this.editHandler,
1434
- on: this.v3 ? undefined : {
1435
- "edit": this.editHandler,
1436
- "remove": this.removeHandler,
1437
- "save": this.saveHandler,
1438
- "cancel": this.cancelHandler,
1439
- "change": this.itemChange
1440
- },
1441
- onRemove: this.removeHandler,
1442
- onSave: this.saveHandler,
1443
- onCancel: this.cancelHandler,
1444
- onChange: this.itemChange,
1445
- columnIndex: index,
1446
- columnsCount: this._columns.filter(function (c) {
1447
- return !c.children.length;
1448
- }).length,
1449
- rowType: item.rowType,
1450
- level: item.level,
1451
- expanded: isExpanded,
1452
- dataIndex: item.dataIndex,
1453
- style: style
1454
- }),
1455
- inbuildCell: h(GridCell, {
1456
- key: index,
1457
- id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1458
- attrs: this.v3 ? undefined : {
1459
- id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1460
- colSpan: colSpans[index],
1461
- dataItem: item.dataItem,
1462
- field: column.field || '' // todo
1463
- ,
1464
- editor: column.editor,
1465
- format: column.format,
1466
- readFormat: column.readFormat,
1467
- type: column.type,
1468
- className: className,
1469
- render: columnCellRenderFunction || cellRenderFunction,
1470
- columnIndex: index,
1471
- columnsCount: this._columns.filter(function (c) {
1472
- return !c.children.length;
1473
- }).length,
1474
- rowType: item.rowType,
1475
- level: item.level,
1476
- expanded: isExpanded,
1477
- dataIndex: item.dataIndex
1478
- },
1479
- colSpan: colSpans[index],
1480
- dataItem: item.dataItem,
1481
- field: column.field || '',
1482
- editor: column.editor,
1483
- format: column.format,
1484
- readFormat: column.readFormat,
1485
- type: column.type,
1486
- className: className,
1487
- render: columnCellRenderFunction || cellRenderFunction,
1488
- onCellclick: this.cellClickHandler,
1489
- on: this.v3 ? undefined : {
1490
- "cellclick": this.cellClickHandler,
1491
- "cellkeydown": this.cellKeydownHandler,
1492
- "edit": this.editHandler,
1493
- "remove": this.removeHandler,
1494
- "save": this.saveHandler,
1495
- "cancel": this.cancelHandler,
1496
- "change": this.itemChange,
1497
- "selectionchange": function selectionchange(e) {
1498
- return _this.selectionChangeHandler({
1499
- event: e,
1500
- dataItem: item.dataItem,
1501
- dataIndex: rowDataIndex,
1502
- columnIndex: index
1503
- });
1504
- }
1505
- },
1506
- onCellkeydown: this.cellKeydownHandler,
1507
- onEdit: this.editHandler,
1508
- onRemove: this.removeHandler,
1509
- onSave: this.saveHandler,
1510
- onCancel: this.cancelHandler,
1511
- onChange: this.itemChange,
1512
- onSelectionchange: function selectionchange(e) {
1513
- return _this.selectionChangeHandler({
1514
- event: e,
1515
- dataItem: item.dataItem,
1516
- dataIndex: rowDataIndex,
1517
- columnIndex: index
1518
- });
1519
- },
1520
- columnIndex: index,
1521
- columnsCount: this._columns.filter(function (c) {
1522
- return !c.children.length;
1523
- }).length,
1524
- rowType: item.rowType,
1525
- level: item.level,
1526
- expanded: isExpanded,
1527
- dataIndex: item.dataIndex,
1528
- style: style
1529
- })
1530
- },
1531
- editField: this.$props.editField,
1532
- column: column,
1533
- editCell: h(GridEditCell, {
1405
+ if (currentColumnIsInEdit) {
1406
+ // @ts-ignore
1407
+ return h(GridEditCell, {
1534
1408
  id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1535
1409
  attrs: this.v3 ? undefined : {
1536
1410
  id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1537
1411
  colSpan: colSpans[index],
1538
1412
  dataItem: item.dataItem,
1539
- field: column.field || '',
1413
+ field: column.field || '' // todo
1414
+ ,
1540
1415
  editor: column.editor,
1541
1416
  format: column.format,
1542
1417
  readFormat: column.readFormat,
@@ -1583,71 +1458,23 @@ var GridVue2 = {
1583
1458
  expanded: isExpanded,
1584
1459
  dataIndex: item.dataIndex,
1585
1460
  style: style
1586
- }),
1587
- inbuildCell: h(GridCell, {
1588
- key: index,
1461
+ });
1462
+ }
1463
+ var inbuiltSlot = h(GridCell, {
1464
+ key: index,
1465
+ id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1466
+ attrs: this.v3 ? undefined : {
1589
1467
  id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1590
- attrs: this.v3 ? undefined : {
1591
- id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(index)), idPrefix),
1592
- colSpan: colSpans[index],
1593
- dataItem: item.dataItem,
1594
- field: column.field || '',
1595
- editor: column.editor,
1596
- format: column.format,
1597
- readFormat: column.readFormat,
1598
- type: column.type,
1599
- className: className,
1600
- render: columnCellRenderFunction || cellRenderFunction,
1601
- columnIndex: index,
1602
- columnsCount: this._columns.filter(function (c) {
1603
- return !c.children.length;
1604
- }).length,
1605
- rowType: item.rowType,
1606
- level: item.level,
1607
- expanded: isExpanded,
1608
- dataIndex: item.dataIndex
1609
- },
1610
1468
  colSpan: colSpans[index],
1611
1469
  dataItem: item.dataItem,
1612
- field: column.field || '',
1470
+ field: column.field || '' // todo
1471
+ ,
1613
1472
  editor: column.editor,
1614
1473
  format: column.format,
1615
1474
  readFormat: column.readFormat,
1616
1475
  type: column.type,
1617
1476
  className: className,
1618
1477
  render: columnCellRenderFunction || cellRenderFunction,
1619
- onCellclick: this.cellClickHandler,
1620
- on: this.v3 ? undefined : {
1621
- "cellclick": this.cellClickHandler,
1622
- "cellkeydown": this.cellKeydownHandler,
1623
- "edit": this.editHandler,
1624
- "remove": this.removeHandler,
1625
- "save": this.saveHandler,
1626
- "cancel": this.cancelHandler,
1627
- "change": this.itemChange,
1628
- "selectionchange": function selectionchange(e) {
1629
- return _this.selectionChangeHandler({
1630
- event: e,
1631
- dataItem: item.dataItem,
1632
- dataIndex: rowDataIndex,
1633
- columnIndex: index
1634
- });
1635
- }
1636
- },
1637
- onCellkeydown: this.cellKeydownHandler,
1638
- onEdit: this.editHandler,
1639
- onRemove: this.removeHandler,
1640
- onSave: this.saveHandler,
1641
- onCancel: this.cancelHandler,
1642
- onChange: this.itemChange,
1643
- onSelectionchange: function selectionchange(e) {
1644
- return _this.selectionChangeHandler({
1645
- event: e,
1646
- dataItem: item.dataItem,
1647
- dataIndex: rowDataIndex,
1648
- columnIndex: index
1649
- });
1650
- },
1651
1478
  columnIndex: index,
1652
1479
  columnsCount: this._columns.filter(function (c) {
1653
1480
  return !c.children.length;
@@ -1655,11 +1482,63 @@ var GridVue2 = {
1655
1482
  rowType: item.rowType,
1656
1483
  level: item.level,
1657
1484
  expanded: isExpanded,
1658
- dataIndex: item.dataIndex,
1659
- style: style
1660
- })
1485
+ dataIndex: item.dataIndex
1486
+ },
1487
+ colSpan: colSpans[index],
1488
+ dataItem: item.dataItem,
1489
+ field: column.field || '',
1490
+ editor: column.editor,
1491
+ format: column.format,
1492
+ readFormat: column.readFormat,
1493
+ type: column.type,
1494
+ className: className,
1495
+ render: columnCellRenderFunction || cellRenderFunction,
1496
+ onCellclick: this.cellClickHandler,
1497
+ on: this.v3 ? undefined : {
1498
+ "cellclick": this.cellClickHandler,
1499
+ "cellkeydown": this.cellKeydownHandler,
1500
+ "edit": this.editHandler,
1501
+ "remove": this.removeHandler,
1502
+ "save": this.saveHandler,
1503
+ "cancel": this.cancelHandler,
1504
+ "change": this.itemChange,
1505
+ "selectionchange": function selectionchange(e) {
1506
+ return _this.selectionChangeHandler({
1507
+ event: e,
1508
+ dataItem: item.dataItem,
1509
+ dataIndex: rowDataIndex,
1510
+ columnIndex: index
1511
+ });
1512
+ }
1513
+ },
1514
+ onCellkeydown: this.cellKeydownHandler,
1515
+ onEdit: this.editHandler,
1516
+ onRemove: this.removeHandler,
1517
+ onSave: this.saveHandler,
1518
+ onCancel: this.cancelHandler,
1519
+ onChange: this.itemChange,
1520
+ onSelectionchange: function selectionchange(e) {
1521
+ return _this.selectionChangeHandler({
1522
+ event: e,
1523
+ dataItem: item.dataItem,
1524
+ dataIndex: rowDataIndex,
1525
+ columnIndex: index
1526
+ });
1527
+ },
1528
+ columnIndex: index,
1529
+ columnsCount: this._columns.filter(function (c) {
1530
+ return !c.children.length;
1531
+ }).length,
1532
+ rowType: item.rowType,
1533
+ level: item.level,
1534
+ expanded: isExpanded,
1535
+ dataIndex: item.dataIndex,
1536
+ style: style
1661
1537
  });
1662
- }, this)
1538
+ return inbuiltSlot;
1539
+ }, this),
1540
+ isInEdit: isInEdit,
1541
+ isSelected: typeof selectedValue === 'boolean' && selectedValue
1663
1542
  };
1664
1543
  };
1665
1544
  var hiddenRows = 0;
@@ -1723,6 +1602,8 @@ var GridVue2 = {
1723
1602
  attrs: this.v3 ? undefined : {
1724
1603
  dataItem: item.dataItem,
1725
1604
  isAltRow: isAlt,
1605
+ isInEdit: dataRow.isInEdit,
1606
+ isSelected: dataRow.isSelected,
1726
1607
  rowType: item.rowType,
1727
1608
  isHidden: hidden(rowIndex),
1728
1609
  selectedField: this.$props.selectedField,
@@ -1732,6 +1613,8 @@ var GridVue2 = {
1732
1613
  dataIndex: dataIndex
1733
1614
  },
1734
1615
  isAltRow: isAlt,
1616
+ isInEdit: dataRow.isInEdit,
1617
+ isSelected: dataRow.isSelected,
1735
1618
  rowType: item.rowType,
1736
1619
  isHidden: hidden(rowIndex),
1737
1620
  onRowclick: function onRowclick(e) {
@@ -271,7 +271,7 @@ export interface GridProps {
271
271
  /**
272
272
  * Defines the custom rendering of the row. Accepts a Vue component, a `render` function, or a slot name.
273
273
  */
274
- rowRender?: string | boolean | ((h: any, defaultRendering: any | null, dafaultSlots: any, props: any, listeners: any) => any);
274
+ rowRender?: string | boolean | ((h: any, defaultRendering: any | null, defaultSlots: any, props: any, listeners: any) => any);
275
275
  /**
276
276
  * Defines the custom rendering of the cell. Accepts a Vue component, a `render` function, or a slot name.
277
277
  * ([see example]({% slug groupingaggregates_grid %})).
@@ -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: 1712919383,
8
+ publishDate: 1713770264,
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
  };