@progress/kendo-vue-grid 5.1.0 → 5.2.0-dev.202406141341

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
@@ -154,7 +154,8 @@ var GridVue2 = {
154
154
  isRtl: false,
155
155
  context: undefined,
156
156
  navigation: undefined,
157
- showLicenseWatermark: false
157
+ showLicenseWatermark: false,
158
+ notHiddenColumns: []
158
159
  };
159
160
  },
160
161
  watch: {
@@ -197,6 +198,10 @@ var GridVue2 = {
197
198
  this.isRtl = rtl;
198
199
  // @ts-ignore
199
200
  this.initialHeight = this._element.style ? this._element.style.height : null;
201
+ this.resizeObserver = canUseDOM && window.ResizeObserver && new ResizeObserver(this.calculateMedia);
202
+ if ((document === null || document === void 0 ? void 0 : document.body) && this.resizeObserver) {
203
+ this.resizeObserver.observe(document.body);
204
+ }
200
205
  },
201
206
  updated: function updated() {
202
207
  this.setRefs();
@@ -298,6 +303,40 @@ var GridVue2 = {
298
303
  }
299
304
  },
300
305
  methods: {
306
+ getColumnsEssentialProps: function getColumnsEssentialProps(columns) {
307
+ return JSON.stringify(columns.map(function (el) {
308
+ return {
309
+ id: el.id,
310
+ field: el.field,
311
+ title: el.title,
312
+ children: el.children
313
+ };
314
+ }));
315
+ },
316
+ calculateMedia: function calculateMedia() {
317
+ var filteredColumns = this.filterHiddenColumns(this.$props.columns);
318
+ if (this.getColumnsEssentialProps(this.notHiddenColumns) !== this.getColumnsEssentialProps(filteredColumns)) {
319
+ this.$forceUpdate();
320
+ }
321
+ },
322
+ filterHiddenColumns: function filterHiddenColumns(columns) {
323
+ var _this = this;
324
+ if (!columns || columns.length === 0) {
325
+ return columns;
326
+ }
327
+ var filterNestedColumns = function filterNestedColumns(column) {
328
+ return __assign(__assign({}, column), {
329
+ children: column.children && column.children.length > 0 ? _this.filterHiddenColumns(column.children) : column.children
330
+ });
331
+ };
332
+ return __spreadArray([], columns, true).filter(function (col) {
333
+ return !col.hidden;
334
+ }).filter(function (col) {
335
+ return canUseDOM && col && col.media ? window.matchMedia(col.media).matches : col;
336
+ }).map(function (col) {
337
+ return filterNestedColumns(col);
338
+ });
339
+ },
301
340
  /**
302
341
  * A getter of the current columns. Gets the current column width or current columns,
303
342
  * or any other [`GridColumnProps`]({% slug api_grid_gridcolumnprops %}) for each defined column.
@@ -363,6 +402,9 @@ var GridVue2 = {
363
402
  }
364
403
  this.currentData = [];
365
404
  this._columns = [];
405
+ if ((document === null || document === void 0 ? void 0 : document.body) && this.resizeObserver) {
406
+ this.resizeObserver.disconnect();
407
+ }
366
408
  },
367
409
  resetVirtual: function resetVirtual() {
368
410
  this.vs.PageChange = this.pageChangeHandler;
@@ -916,10 +958,8 @@ var GridVue2 = {
916
958
  index: this.$props.skip || 0
917
959
  }, this.$props.group !== undefined, this.$props.expandField);
918
960
  var children = defaultSlot || [];
919
- var notHiddenColumns = this.$props.columns ? this.$props.columns.filter(function (column) {
920
- return !column.hidden;
921
- }) : this.$props.columns;
922
- this.initColumns(notHiddenColumns, resolvedGroupsCount);
961
+ this.notHiddenColumns = this.filterHiddenColumns(this.$props.columns);
962
+ this.initColumns(this.notHiddenColumns, resolvedGroupsCount);
923
963
  var toolbar = children.filter(function (child) {
924
964
  return child && child.tag && child.tag.toLowerCase().indexOf('toolbar') !== -1 || child.componentOptions && child.componentOptions.tag && child.componentOptions.tag.toLowerCase().indexOf('toolbar') !== -1 || child.type && child.type.name && child.type.name.toLowerCase().indexOf('toolbar') !== -1;
925
965
  });
@@ -102,9 +102,13 @@ export interface GridColumnProps {
102
102
  */
103
103
  format?: string;
104
104
  /**
105
- * Indicates whether the column is hidden.
105
+ * Controls the visibility of Grid's column. Defaults to `false`.
106
106
  */
107
107
  hidden?: boolean;
108
+ /**
109
+ * Sets the screen size condition that needs to be satisfied for a column to remain visible. If you set the hidden property, the behavior of media is overridden.
110
+ */
111
+ media?: string;
108
112
  /**
109
113
  * Sets the custom CSS classes to the column header cell.
110
114
  */
@@ -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: 1718172992,
8
+ publishDate: 1718372182,
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
  };
@@ -140,9 +140,8 @@ export function mapColumns(columns) {
140
140
  for (var q = columns.length - 1; q >= 0; q--) {
141
141
  maxDepth = Math.max(maxDepth, columns[q].depth);
142
142
  columns[q].colSpan = columns[q].colSpan || 1;
143
- if (columns[q].parentIndex !== -1) {
144
- columns[columns[q].parentIndex].colSpan =
145
- (columns[columns[q].parentIndex].colSpan || 0) + columns[q].colSpan;
143
+ if (columns[q].children.length > 0) {
144
+ columns[q].colSpan = columns[q].children.reduce(function (sum, child) { return (!child.hidden ? sum + child.colSpan : sum); }, 0);
146
145
  }
147
146
  }
148
147
  var rowSpan = 1;
package/dist/esm/Grid.js CHANGED
@@ -154,7 +154,8 @@ var GridVue2 = {
154
154
  isRtl: false,
155
155
  context: undefined,
156
156
  navigation: undefined,
157
- showLicenseWatermark: false
157
+ showLicenseWatermark: false,
158
+ notHiddenColumns: []
158
159
  };
159
160
  },
160
161
  watch: {
@@ -197,6 +198,10 @@ var GridVue2 = {
197
198
  this.isRtl = rtl;
198
199
  // @ts-ignore
199
200
  this.initialHeight = this._element.style ? this._element.style.height : null;
201
+ this.resizeObserver = canUseDOM && window.ResizeObserver && new ResizeObserver(this.calculateMedia);
202
+ if ((document === null || document === void 0 ? void 0 : document.body) && this.resizeObserver) {
203
+ this.resizeObserver.observe(document.body);
204
+ }
200
205
  },
201
206
  updated: function updated() {
202
207
  this.setRefs();
@@ -298,6 +303,40 @@ var GridVue2 = {
298
303
  }
299
304
  },
300
305
  methods: {
306
+ getColumnsEssentialProps: function getColumnsEssentialProps(columns) {
307
+ return JSON.stringify(columns.map(function (el) {
308
+ return {
309
+ id: el.id,
310
+ field: el.field,
311
+ title: el.title,
312
+ children: el.children
313
+ };
314
+ }));
315
+ },
316
+ calculateMedia: function calculateMedia() {
317
+ var filteredColumns = this.filterHiddenColumns(this.$props.columns);
318
+ if (this.getColumnsEssentialProps(this.notHiddenColumns) !== this.getColumnsEssentialProps(filteredColumns)) {
319
+ this.$forceUpdate();
320
+ }
321
+ },
322
+ filterHiddenColumns: function filterHiddenColumns(columns) {
323
+ var _this = this;
324
+ if (!columns || columns.length === 0) {
325
+ return columns;
326
+ }
327
+ var filterNestedColumns = function filterNestedColumns(column) {
328
+ return __assign(__assign({}, column), {
329
+ children: column.children && column.children.length > 0 ? _this.filterHiddenColumns(column.children) : column.children
330
+ });
331
+ };
332
+ return __spreadArray([], columns, true).filter(function (col) {
333
+ return !col.hidden;
334
+ }).filter(function (col) {
335
+ return canUseDOM && col && col.media ? window.matchMedia(col.media).matches : col;
336
+ }).map(function (col) {
337
+ return filterNestedColumns(col);
338
+ });
339
+ },
301
340
  /**
302
341
  * A getter of the current columns. Gets the current column width or current columns,
303
342
  * or any other [`GridColumnProps`]({% slug api_grid_gridcolumnprops %}) for each defined column.
@@ -363,6 +402,9 @@ var GridVue2 = {
363
402
  }
364
403
  this.currentData = [];
365
404
  this._columns = [];
405
+ if ((document === null || document === void 0 ? void 0 : document.body) && this.resizeObserver) {
406
+ this.resizeObserver.disconnect();
407
+ }
366
408
  },
367
409
  resetVirtual: function resetVirtual() {
368
410
  this.vs.PageChange = this.pageChangeHandler;
@@ -916,10 +958,8 @@ var GridVue2 = {
916
958
  index: this.$props.skip || 0
917
959
  }, this.$props.group !== undefined, this.$props.expandField);
918
960
  var children = defaultSlot || [];
919
- var notHiddenColumns = this.$props.columns ? this.$props.columns.filter(function (column) {
920
- return !column.hidden;
921
- }) : this.$props.columns;
922
- this.initColumns(notHiddenColumns, resolvedGroupsCount);
961
+ this.notHiddenColumns = this.filterHiddenColumns(this.$props.columns);
962
+ this.initColumns(this.notHiddenColumns, resolvedGroupsCount);
923
963
  var toolbar = children.filter(function (child) {
924
964
  return child && child.tag && child.tag.toLowerCase().indexOf('toolbar') !== -1 || child.componentOptions && child.componentOptions.tag && child.componentOptions.tag.toLowerCase().indexOf('toolbar') !== -1 || child.type && child.type.name && child.type.name.toLowerCase().indexOf('toolbar') !== -1;
925
965
  });
@@ -102,9 +102,13 @@ export interface GridColumnProps {
102
102
  */
103
103
  format?: string;
104
104
  /**
105
- * Indicates whether the column is hidden.
105
+ * Controls the visibility of Grid's column. Defaults to `false`.
106
106
  */
107
107
  hidden?: boolean;
108
+ /**
109
+ * Sets the screen size condition that needs to be satisfied for a column to remain visible. If you set the hidden property, the behavior of media is overridden.
110
+ */
111
+ media?: string;
108
112
  /**
109
113
  * Sets the custom CSS classes to the column header cell.
110
114
  */
@@ -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: 1718172992,
8
+ publishDate: 1718372182,
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
  };
@@ -140,9 +140,8 @@ export function mapColumns(columns) {
140
140
  for (var q = columns.length - 1; q >= 0; q--) {
141
141
  maxDepth = Math.max(maxDepth, columns[q].depth);
142
142
  columns[q].colSpan = columns[q].colSpan || 1;
143
- if (columns[q].parentIndex !== -1) {
144
- columns[columns[q].parentIndex].colSpan =
145
- (columns[columns[q].parentIndex].colSpan || 0) + columns[q].colSpan;
143
+ if (columns[q].children.length > 0) {
144
+ columns[q].colSpan = columns[q].children.reduce(function (sum, child) { return (!child.hidden ? sum + child.colSpan : sum); }, 0);
146
145
  }
147
146
  }
148
147
  var rowSpan = 1;
package/dist/npm/Grid.js CHANGED
@@ -160,7 +160,8 @@ var GridVue2 = {
160
160
  isRtl: false,
161
161
  context: undefined,
162
162
  navigation: undefined,
163
- showLicenseWatermark: false
163
+ showLicenseWatermark: false,
164
+ notHiddenColumns: []
164
165
  };
165
166
  },
166
167
  watch: {
@@ -203,6 +204,10 @@ var GridVue2 = {
203
204
  this.isRtl = rtl;
204
205
  // @ts-ignore
205
206
  this.initialHeight = this._element.style ? this._element.style.height : null;
207
+ this.resizeObserver = kendo_vue_common_1.canUseDOM && window.ResizeObserver && new ResizeObserver(this.calculateMedia);
208
+ if ((document === null || document === void 0 ? void 0 : document.body) && this.resizeObserver) {
209
+ this.resizeObserver.observe(document.body);
210
+ }
206
211
  },
207
212
  updated: function updated() {
208
213
  this.setRefs();
@@ -304,6 +309,40 @@ var GridVue2 = {
304
309
  }
305
310
  },
306
311
  methods: {
312
+ getColumnsEssentialProps: function getColumnsEssentialProps(columns) {
313
+ return JSON.stringify(columns.map(function (el) {
314
+ return {
315
+ id: el.id,
316
+ field: el.field,
317
+ title: el.title,
318
+ children: el.children
319
+ };
320
+ }));
321
+ },
322
+ calculateMedia: function calculateMedia() {
323
+ var filteredColumns = this.filterHiddenColumns(this.$props.columns);
324
+ if (this.getColumnsEssentialProps(this.notHiddenColumns) !== this.getColumnsEssentialProps(filteredColumns)) {
325
+ this.$forceUpdate();
326
+ }
327
+ },
328
+ filterHiddenColumns: function filterHiddenColumns(columns) {
329
+ var _this = this;
330
+ if (!columns || columns.length === 0) {
331
+ return columns;
332
+ }
333
+ var filterNestedColumns = function filterNestedColumns(column) {
334
+ return __assign(__assign({}, column), {
335
+ children: column.children && column.children.length > 0 ? _this.filterHiddenColumns(column.children) : column.children
336
+ });
337
+ };
338
+ return __spreadArray([], columns, true).filter(function (col) {
339
+ return !col.hidden;
340
+ }).filter(function (col) {
341
+ return kendo_vue_common_1.canUseDOM && col && col.media ? window.matchMedia(col.media).matches : col;
342
+ }).map(function (col) {
343
+ return filterNestedColumns(col);
344
+ });
345
+ },
307
346
  /**
308
347
  * A getter of the current columns. Gets the current column width or current columns,
309
348
  * or any other [`GridColumnProps`]({% slug api_grid_gridcolumnprops %}) for each defined column.
@@ -369,6 +408,9 @@ var GridVue2 = {
369
408
  }
370
409
  this.currentData = [];
371
410
  this._columns = [];
411
+ if ((document === null || document === void 0 ? void 0 : document.body) && this.resizeObserver) {
412
+ this.resizeObserver.disconnect();
413
+ }
372
414
  },
373
415
  resetVirtual: function resetVirtual() {
374
416
  this.vs.PageChange = this.pageChangeHandler;
@@ -922,10 +964,8 @@ var GridVue2 = {
922
964
  index: this.$props.skip || 0
923
965
  }, this.$props.group !== undefined, this.$props.expandField);
924
966
  var children = defaultSlot || [];
925
- var notHiddenColumns = this.$props.columns ? this.$props.columns.filter(function (column) {
926
- return !column.hidden;
927
- }) : this.$props.columns;
928
- this.initColumns(notHiddenColumns, resolvedGroupsCount);
967
+ this.notHiddenColumns = this.filterHiddenColumns(this.$props.columns);
968
+ this.initColumns(this.notHiddenColumns, resolvedGroupsCount);
929
969
  var toolbar = children.filter(function (child) {
930
970
  return child && child.tag && child.tag.toLowerCase().indexOf('toolbar') !== -1 || child.componentOptions && child.componentOptions.tag && child.componentOptions.tag.toLowerCase().indexOf('toolbar') !== -1 || child.type && child.type.name && child.type.name.toLowerCase().indexOf('toolbar') !== -1;
931
971
  });
@@ -102,9 +102,13 @@ export interface GridColumnProps {
102
102
  */
103
103
  format?: string;
104
104
  /**
105
- * Indicates whether the column is hidden.
105
+ * Controls the visibility of Grid's column. Defaults to `false`.
106
106
  */
107
107
  hidden?: boolean;
108
+ /**
109
+ * Sets the screen size condition that needs to be satisfied for a column to remain visible. If you set the hidden property, the behavior of media is overridden.
110
+ */
111
+ media?: string;
108
112
  /**
109
113
  * Sets the custom CSS classes to the column header cell.
110
114
  */
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-vue-grid',
9
9
  productName: 'Kendo UI for Vue',
10
10
  productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
11
- publishDate: 1718172992,
11
+ publishDate: 1718372182,
12
12
  version: '',
13
13
  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'
14
14
  };
@@ -148,9 +148,8 @@ function mapColumns(columns) {
148
148
  for (var q = columns.length - 1; q >= 0; q--) {
149
149
  maxDepth = Math.max(maxDepth, columns[q].depth);
150
150
  columns[q].colSpan = columns[q].colSpan || 1;
151
- if (columns[q].parentIndex !== -1) {
152
- columns[columns[q].parentIndex].colSpan =
153
- (columns[columns[q].parentIndex].colSpan || 0) + columns[q].colSpan;
151
+ if (columns[q].children.length > 0) {
152
+ columns[q].colSpan = columns[q].children.reduce(function (sum, child) { return (!child.hidden ? sum + child.colSpan : sum); }, 0);
154
153
  }
155
154
  }
156
155
  var rowSpan = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-vue-grid",
3
- "version": "5.1.0",
3
+ "version": "5.2.0-dev.202406141341",
4
4
  "description": "Kendo UI for Vue Grid package",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,25 +44,25 @@
44
44
  "vue": "^2.6.12 || ^3.0.2"
45
45
  },
46
46
  "dependencies": {
47
- "@progress/kendo-vue-common": "5.1.0"
47
+ "@progress/kendo-vue-common": "5.2.0-dev.202406141341"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@progress/kendo-data-query": "^1.7.0",
51
51
  "@progress/kendo-drawing": "^1.20.1",
52
52
  "@progress/kendo-licensing": "^1.3.0",
53
53
  "@progress/kendo-svg-icons": "^3.0.0",
54
- "@progress/kendo-vue-animation": "5.1.0",
55
- "@progress/kendo-vue-buttons": "5.1.0",
56
- "@progress/kendo-vue-charts": "5.1.0",
57
- "@progress/kendo-vue-data-tools": "5.1.0",
58
- "@progress/kendo-vue-dateinputs": "5.1.0",
59
- "@progress/kendo-vue-dropdowns": "5.1.0",
60
- "@progress/kendo-vue-excel-export": "5.1.0",
61
- "@progress/kendo-vue-indicators": "5.1.0",
62
- "@progress/kendo-vue-inputs": "5.1.0",
63
- "@progress/kendo-vue-intl": "5.1.0",
64
- "@progress/kendo-vue-pdf": "5.1.0",
65
- "@progress/kendo-vue-popup": "5.1.0",
54
+ "@progress/kendo-vue-animation": "5.2.0-dev.202406141341",
55
+ "@progress/kendo-vue-buttons": "5.2.0-dev.202406141341",
56
+ "@progress/kendo-vue-charts": "5.2.0-dev.202406141341",
57
+ "@progress/kendo-vue-data-tools": "5.2.0-dev.202406141341",
58
+ "@progress/kendo-vue-dateinputs": "5.2.0-dev.202406141341",
59
+ "@progress/kendo-vue-dropdowns": "5.2.0-dev.202406141341",
60
+ "@progress/kendo-vue-excel-export": "5.2.0-dev.202406141341",
61
+ "@progress/kendo-vue-indicators": "5.2.0-dev.202406141341",
62
+ "@progress/kendo-vue-inputs": "5.2.0-dev.202406141341",
63
+ "@progress/kendo-vue-intl": "5.2.0-dev.202406141341",
64
+ "@progress/kendo-vue-pdf": "5.2.0-dev.202406141341",
65
+ "@progress/kendo-vue-popup": "5.2.0-dev.202406141341",
66
66
  "cldr-core": "^41.0.0",
67
67
  "cldr-dates-full": "^41.0.0",
68
68
  "cldr-numbers-full": "^41.0.0"