New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vaadin/grid

Package Overview
Dependencies
Maintainers
14
Versions
427
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaadin/grid - npm Package Compare versions

Comparing version 23.2.0-alpha2 to 23.2.0-alpha3

20

package.json
{
"name": "@vaadin/grid",
"version": "23.2.0-alpha2",
"version": "23.2.0-alpha3",
"publishConfig": {

@@ -46,13 +46,13 @@ "access": "public"

"@polymer/polymer": "^3.0.0",
"@vaadin/checkbox": "23.2.0-alpha2",
"@vaadin/component-base": "23.2.0-alpha2",
"@vaadin/lit-renderer": "23.2.0-alpha2",
"@vaadin/text-field": "23.2.0-alpha2",
"@vaadin/vaadin-lumo-styles": "23.2.0-alpha2",
"@vaadin/vaadin-material-styles": "23.2.0-alpha2",
"@vaadin/vaadin-themable-mixin": "23.2.0-alpha2"
"@vaadin/checkbox": "23.2.0-alpha3",
"@vaadin/component-base": "23.2.0-alpha3",
"@vaadin/lit-renderer": "23.2.0-alpha3",
"@vaadin/text-field": "23.2.0-alpha3",
"@vaadin/vaadin-lumo-styles": "23.2.0-alpha3",
"@vaadin/vaadin-material-styles": "23.2.0-alpha3",
"@vaadin/vaadin-themable-mixin": "23.2.0-alpha3"
},
"devDependencies": {
"@esm-bundle/chai": "^4.3.4",
"@vaadin/polymer-legacy-adapter": "23.2.0-alpha2",
"@vaadin/polymer-legacy-adapter": "23.2.0-alpha3",
"@vaadin/testing-helpers": "^0.3.2",

@@ -62,3 +62,3 @@ "lit": "^2.0.0",

},
"gitHead": "c9b8113d0fa9a602f8b9cb915c1826355af2e8df"
"gitHead": "06e5875be93ca50da2846dafc65a8531010c0576"
}

@@ -7,7 +7,8 @@ /**

/* eslint-disable max-classes-per-file */
import { TemplateResult } from 'lit';
import { DirectiveResult } from 'lit/directive';
import { LitRenderer, LitRendererDirective } from '@vaadin/lit-renderer';
import { GridItemModel } from '../vaadin-grid.js';
import { GridColumn } from '../vaadin-grid-column.js';
import type { TemplateResult } from 'lit';
import type { DirectiveResult } from 'lit/directive';
import type { LitRenderer } from '@vaadin/lit-renderer';
import { LitRendererDirective } from '@vaadin/lit-renderer';
import type { GridItemModel } from '../vaadin-grid.js';
import type { GridColumn } from '../vaadin-grid-column.js';

@@ -14,0 +15,0 @@ export type GridColumnBodyLitRenderer<TItem> = (

@@ -6,6 +6,6 @@ /**

*/
import { TemplateResult } from 'lit';
import { DirectiveResult } from 'lit/directive';
import type { TemplateResult } from 'lit';
import type { DirectiveResult } from 'lit/directive';
import { LitRendererDirective } from '@vaadin/lit-renderer';
import { Grid, GridItemModel } from '../vaadin-grid.js';
import type { Grid, GridItemModel } from '../vaadin-grid.js';

@@ -12,0 +12,0 @@ export type GridRowDetailsLitRenderer<TItem> = (item: TItem, model: GridItemModel<TItem>, grid: Grid) => TemplateResult;

@@ -6,3 +6,3 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import type { Constructor } from '@open-wc/dedupe-mixin';

@@ -9,0 +9,0 @@ export declare function ActiveItemMixin<TItem, T extends Constructor<HTMLElement>>(

@@ -6,3 +6,3 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import type { Constructor } from '@open-wc/dedupe-mixin';

@@ -9,0 +9,0 @@ export declare function ArrayDataProviderMixin<TItem, T extends Constructor<HTMLElement>>(

@@ -6,4 +6,4 @@ /**

*/
import { GridDefaultItem } from './vaadin-grid.js';
import { ColumnBaseMixinClass } from './vaadin-grid-column.js';
import type { GridDefaultItem } from './vaadin-grid.js';
import type { ColumnBaseMixinClass } from './vaadin-grid-column.js';

@@ -10,0 +10,0 @@ /**

@@ -159,3 +159,5 @@ /**

if (!order) {
_rootColumns.forEach((column) => (column._order = 0));
_rootColumns.forEach((column) => {
column._order = 0;
});
return;

@@ -194,3 +196,5 @@ }

rootColumns.forEach((column) => (column._reorderStatus = reorderStatus));
rootColumns.forEach((column) => {
column._reorderStatus = reorderStatus;
});
}

@@ -204,3 +208,5 @@

rootColumns.forEach((column) => (column.resizable = resizable));
rootColumns.forEach((column) => {
column.resizable = resizable;
});
}

@@ -223,3 +229,6 @@

const width = this._visibleChildColumns
.reduce((prev, curr) => (prev += ` + ${(curr.width || '0px').replace('calc', '')}`), '')
.reduce((prev, curr) => {
prev += ` + ${(curr.width || '0px').replace('calc', '')}`;
return prev;
}, '')
.substring(3);

@@ -242,3 +251,5 @@ this._setWidth(`calc(${width})`);

if (frozen !== false) {
Array.from(rootColumns).forEach((col) => (col.frozen = frozen));
Array.from(rootColumns).forEach((col) => {
col.frozen = frozen;
});
}

@@ -255,3 +266,5 @@ }

if (frozenToEnd !== false) {
Array.from(rootColumns).forEach((col) => (col.frozenToEnd = frozenToEnd));
Array.from(rootColumns).forEach((col) => {
col.frozenToEnd = frozenToEnd;
});
}

@@ -285,3 +298,5 @@ }

if (this._childColumns && !this._preventHiddenSynchronization) {
this._childColumns.forEach((column) => (column.hidden = this.hidden));
this._childColumns.forEach((column) => {
column.hidden = this.hidden;
});
}

@@ -288,0 +303,0 @@ }

@@ -6,3 +6,3 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import type { Constructor } from '@open-wc/dedupe-mixin';

@@ -9,0 +9,0 @@ export declare function ColumnReorderingMixin<T extends Constructor<HTMLElement>>(

@@ -266,3 +266,5 @@ /**

'overflow',
].forEach((propertyName) => (ghost.style[propertyName] = style[propertyName]));
].forEach((propertyName) => {
ghost.style[propertyName] = style[propertyName];
});
return ghost;

@@ -278,3 +280,5 @@ }

// Reset all column orders
columnTree[0].forEach((column) => (column._order = 0));
columnTree[0].forEach((column) => {
column._order = 0;
});
// Set order numbers to top-level columns

@@ -292,3 +296,5 @@ updateColumnOrders(columnTree[0], this._orderBaseScope, 0);

.filter((child) => /column/.test(child.localName) && this._isSwapAllowed(child, column))
.forEach((sibling) => (sibling._reorderStatus = status));
.forEach((sibling) => {
sibling._reorderStatus = status;
});
}

@@ -295,0 +301,0 @@

@@ -6,4 +6,4 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import { GridDefaultItem, GridItemModel } from './vaadin-grid.js';
import type { Constructor } from '@open-wc/dedupe-mixin';
import type { GridDefaultItem, GridItemModel } from './vaadin-grid.js';

@@ -10,0 +10,0 @@ export type GridBodyRenderer<TItem> = (

@@ -315,3 +315,5 @@ /**

this._allCells.forEach((cell) => (cell.style.flexGrow = flexGrow));
this._allCells.forEach((cell) => {
cell.style.flexGrow = flexGrow;
});
}

@@ -321,3 +323,5 @@

_orderChanged(order) {
this._allCells.forEach((cell) => (cell.style.order = order));
this._allCells.forEach((cell) => {
cell.style.order = order;
});
}

@@ -331,3 +335,5 @@

this._allCells.forEach((cell) => (cell.style.width = width));
this._allCells.forEach((cell) => {
cell.style.width = width;
});
}

@@ -334,0 +340,0 @@

@@ -6,3 +6,3 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import type { Constructor } from '@open-wc/dedupe-mixin';
import { GridSorterDirection } from './vaadin-grid-sorter.js';

@@ -9,0 +9,0 @@

@@ -6,4 +6,4 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import { GridItemModel } from './vaadin-grid.js';
import type { Constructor } from '@open-wc/dedupe-mixin';
import type { GridItemModel } from './vaadin-grid.js';

@@ -10,0 +10,0 @@ export type GridDragAndDropFilter<TItem> = (model: GridItemModel<TItem>) => boolean;

@@ -283,3 +283,5 @@ /**

// Disallow more auto-scrolls within 20ms
setTimeout(() => (this.__dndAutoScrolling = false), 20);
setTimeout(() => {
this.__dndAutoScrolling = false;
}, 20);
return true;

@@ -286,0 +288,0 @@ }

@@ -6,4 +6,4 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import { GridColumn } from './vaadin-grid-column.js';
import type { Constructor } from '@open-wc/dedupe-mixin';
import type { GridColumn } from './vaadin-grid-column.js';

@@ -10,0 +10,0 @@ export interface GridEventContext<TItem> {

@@ -6,3 +6,3 @@ /**

*/
import { GridDefaultItem } from './vaadin-grid.js';
import type { GridDefaultItem } from './vaadin-grid.js';
import { GridColumn } from './vaadin-grid-column.js';

@@ -9,0 +9,0 @@

@@ -98,3 +98,5 @@ /**

});
this.addEventListener('mouseup', () => (this._isMousedown = false));
this.addEventListener('mouseup', () => {
this._isMousedown = false;
});
}

@@ -374,3 +376,3 @@

* @private
**/
*/
_onRowNavigation(activeRow, dy) {

@@ -399,3 +401,3 @@ const { dstRow } = this.__navigateRows(dy, activeRow);

* @private
**/
*/
__navigateRows(dy, activeRow, activeCell) {

@@ -475,3 +477,3 @@ const currentRowIndex = this.__getIndexInGroup(activeRow, this._focusedItemIndex);

* @private
**/
*/
_onCellNavigation(activeCell, dx, dy) {

@@ -753,6 +755,7 @@ const activeRow = activeCell.parentNode;

/** @private
/**
* Enables interaction mode if a cells descendant receives focus or keyboard
* input. Disables it if the event is not related to cell content.
* @param {!KeyboardEvent|!FocusEvent} e
* @private
*/

@@ -773,3 +776,3 @@ _detectInteracting(e) {

/** @private
/**
* Enables or disables the focus target of the containing section of the

@@ -779,2 +782,3 @@ * grid from receiving focus, based on whether the user is interacting with

* @param {HTMLElement} focusTarget
* @private
*/

@@ -781,0 +785,0 @@ _updateGridSectionFocusTarget(focusTarget) {

@@ -6,4 +6,4 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import { Grid, GridItemModel } from './vaadin-grid.js';
import type { Constructor } from '@open-wc/dedupe-mixin';
import type { Grid, GridItemModel } from './vaadin-grid.js';

@@ -10,0 +10,0 @@ export type GridRowDetailsRenderer<TItem> = (

@@ -6,3 +6,3 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import type { Constructor } from '@open-wc/dedupe-mixin';

@@ -9,0 +9,0 @@ export declare function ScrollMixin<T extends Constructor<HTMLElement>>(base: T): T & Constructor<ScrollMixinClass>;

@@ -72,3 +72,5 @@ /**

});
this.$.items.addEventListener('focusout', () => (this._rowWithFocusedElement = undefined));
this.$.items.addEventListener('focusout', () => {
this._rowWithFocusedElement = undefined;
});

@@ -75,0 +77,0 @@ this.$.table.addEventListener('scroll', () => this._afterScroll());

@@ -6,3 +6,3 @@ /**

*/
import { GridDefaultItem } from './vaadin-grid.js';
import type { GridDefaultItem } from './vaadin-grid.js';
import { GridColumn } from './vaadin-grid-column.js';

@@ -9,0 +9,0 @@

@@ -188,3 +188,5 @@ /**

if (selectAll && Array.isArray(this._grid.items)) {
this.__withFilteredItemsArray((items) => (this._grid.selectedItems = items));
this.__withFilteredItemsArray((items) => {
this._grid.selectedItems = items;
});
} else {

@@ -191,0 +193,0 @@ this._grid.selectedItems = [];

@@ -6,3 +6,3 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import type { Constructor } from '@open-wc/dedupe-mixin';

@@ -9,0 +9,0 @@ export declare function SelectionMixin<TItem, T extends Constructor<HTMLElement>>(

@@ -6,5 +6,5 @@ /**

*/
import { GridDefaultItem } from './vaadin-grid.js';
import type { GridDefaultItem } from './vaadin-grid.js';
import { GridColumn } from './vaadin-grid-column.js';
import { GridSorterDirection } from './vaadin-grid-sorter.js';
import type { GridSorterDirection } from './vaadin-grid-sorter.js';

@@ -11,0 +11,0 @@ /**

@@ -6,3 +6,3 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import type { Constructor } from '@open-wc/dedupe-mixin';

@@ -17,2 +17,18 @@ export declare function SortMixin<T extends Constructor<HTMLElement>>(base: T): T & Constructor<SortMixinClass>;

multiSort: boolean;
/**
* Controls how columns are added to the sort order when using multi-sort.
* The sort order is visually indicated by numbers in grid sorters placed in column headers.
*
* By default, whenever an unsorted column is sorted, or the sort-direction of a column is
* changed, that column gets sort priority 1, thus affecting the priority for all the other
* sorted columns. This is identical to using `multi-sort-priority="prepend"`.
*
* Using this property allows to change this behavior so that sorting an unsorted column
* would add it to the "end" of the sort, and changing column's sort direction would retain
* it's previous priority. To set this, use `multi-sort-priority="append"`.
*
* @attr {string} multi-sort-priority
*/
multiSortPriority: 'prepend' | 'append';
}

@@ -25,2 +25,21 @@ /**

/**
* Controls how columns are added to the sort order when using multi-sort.
* The sort order is visually indicated by numbers in grid sorters placed in column headers.
*
* By default, whenever an unsorted column is sorted, or the sort-direction of a column is
* changed, that column gets sort priority 1, thus affecting the priority for all the other
* sorted columns. This is identical to using `multi-sort-priority="prepend"`.
*
* Using this property allows to change this behavior so that sorting an unsorted column
* would add it to the "end" of the sort, and changing column's sort direction would retain
* it's previous priority. To set this, use `multi-sort-priority="append"`.
*
* @attr {string} multi-sort-priority
*/
multiSortPriority: {
type: String,
value: 'prepend',
},
/**
* @type {!Array<!GridSorterDefinition>}

@@ -52,2 +71,3 @@ * @protected

e.stopPropagation();
sorter._grid = this;
this.__updateSorter(sorter);

@@ -72,6 +92,28 @@ this.__applySorters();

__updateSortOrders() {
this._sorters.forEach((sorter, index) => (sorter._order = this._sorters.length > 1 ? index : null), this);
this._sorters.forEach((sorter, index) => {
sorter._order = this._sorters.length > 1 ? index : null;
});
}
/** @private */
__appendSorter(sorter) {
if (!sorter.direction) {
this._removeArrayItem(this._sorters, sorter);
} else if (!this._sorters.includes(sorter)) {
this._sorters.push(sorter);
}
this.__updateSortOrders();
}
/** @private */
__prependSorter(sorter) {
this._removeArrayItem(this._sorters, sorter);
if (sorter.direction) {
this._sorters.unshift(sorter);
}
this.__updateSortOrders();
}
/** @private */
__updateSorter(sorter) {

@@ -85,7 +127,7 @@ if (!sorter.direction && this._sorters.indexOf(sorter) === -1) {

if (this.multiSort) {
this._removeArrayItem(this._sorters, sorter);
if (sorter.direction) {
this._sorters.unshift(sorter);
if (this.multiSortPriority === 'append') {
this.__appendSorter(sorter);
} else {
this.__prependSorter(sorter);
}
this.__updateSortOrders();
} else if (sorter.direction) {

@@ -92,0 +134,0 @@ const otherSorters = this._sorters.filter((s) => s !== sorter);

@@ -179,2 +179,6 @@ /**

this._isConnected = false;
if (!this.parentNode && this._grid) {
this._grid.__removeSorters([this]);
}
}

@@ -181,0 +185,0 @@

@@ -6,5 +6,5 @@ /**

*/
import { Constructor } from '@open-wc/dedupe-mixin';
import { GridItemModel } from './vaadin-grid.js';
import { GridColumn } from './vaadin-grid-column.js';
import type { Constructor } from '@open-wc/dedupe-mixin';
import type { GridItemModel } from './vaadin-grid.js';
import type { GridColumn } from './vaadin-grid-column.js';

@@ -11,0 +11,0 @@ export type GridCellClassNameGenerator<TItem> = (column: GridColumn<TItem>, model: GridItemModel<TItem>) => string;

@@ -6,3 +6,3 @@ /**

*/
import { GridDefaultItem } from './vaadin-grid.js';
import type { GridDefaultItem } from './vaadin-grid.js';
import { GridColumn } from './vaadin-grid-column.js';

@@ -9,0 +9,0 @@

@@ -6,11 +6,12 @@ /**

*/
import { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
import { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
import { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
import { ActiveItemMixinClass } from './vaadin-grid-active-item-mixin.js';
import { ArrayDataProviderMixinClass } from './vaadin-grid-array-data-provider-mixin.js';
import { GridBodyRenderer, GridColumn, GridHeaderFooterRenderer } from './vaadin-grid-column.js';
import { ColumnReorderingMixinClass } from './vaadin-grid-column-reordering-mixin.js';
import type { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
import type { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
import type { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
import type { ActiveItemMixinClass } from './vaadin-grid-active-item-mixin.js';
import type { ArrayDataProviderMixinClass } from './vaadin-grid-array-data-provider-mixin.js';
import type { GridColumn } from './vaadin-grid-column.js';
import { GridBodyRenderer, GridHeaderFooterRenderer } from './vaadin-grid-column.js';
import type { ColumnReorderingMixinClass } from './vaadin-grid-column-reordering-mixin.js';
import type { DataProviderMixinClass } from './vaadin-grid-data-provider-mixin.js';
import {
DataProviderMixinClass,
GridDataProvider,

@@ -23,14 +24,13 @@ GridDataProviderCallback,

} from './vaadin-grid-data-provider-mixin.js';
import {
DragAndDropMixinClass,
GridDragAndDropFilter,
GridDropLocation,
GridDropMode,
} from './vaadin-grid-drag-and-drop-mixin.js';
import { EventContextMixinClass, GridEventContext } from './vaadin-grid-event-context-mixin.js';
import { GridRowDetailsRenderer, RowDetailsMixinClass } from './vaadin-grid-row-details-mixin.js';
import { ScrollMixinClass } from './vaadin-grid-scroll-mixin.js';
import { SelectionMixinClass } from './vaadin-grid-selection-mixin.js';
import { SortMixinClass } from './vaadin-grid-sort-mixin.js';
import { GridCellClassNameGenerator, StylingMixinClass } from './vaadin-grid-styling-mixin.js';
import type { DragAndDropMixinClass } from './vaadin-grid-drag-and-drop-mixin.js';
import { GridDragAndDropFilter, GridDropLocation, GridDropMode } from './vaadin-grid-drag-and-drop-mixin.js';
import type { EventContextMixinClass } from './vaadin-grid-event-context-mixin.js';
import { GridEventContext } from './vaadin-grid-event-context-mixin.js';
import type { RowDetailsMixinClass } from './vaadin-grid-row-details-mixin.js';
import { GridRowDetailsRenderer } from './vaadin-grid-row-details-mixin.js';
import type { ScrollMixinClass } from './vaadin-grid-scroll-mixin.js';
import type { SelectionMixinClass } from './vaadin-grid-selection-mixin.js';
import type { SortMixinClass } from './vaadin-grid-sort-mixin.js';
import type { StylingMixinClass } from './vaadin-grid-styling-mixin.js';
import { GridCellClassNameGenerator } from './vaadin-grid-styling-mixin.js';

@@ -37,0 +37,0 @@ export {

@@ -711,3 +711,5 @@ /**

Array.from(row.children).forEach((cell) => (cell._vacant = true));
Array.from(row.children).forEach((cell) => {
cell._vacant = true;
});
row.innerHTML = '';

@@ -714,0 +716,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc