@digital-realty/ix-grid 1.4.1-alpha.1 → 1.4.1-alpha.2
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/ix-grid.min.js +5 -5
- package/package.json +4 -4
- package/rollup.config.mjs +32 -6
- package/src/IxGrid.d.ts +148 -0
- package/src/IxGrid.js +784 -0
- package/src/IxGrid.js.map +1 -0
- package/src/IxGridNav.d.ts +2 -0
- package/src/IxGridNav.js +8 -0
- package/src/IxGridNav.js.map +1 -0
- package/src/components/IxGridColumnFilter.d.ts +35 -0
- package/src/components/IxGridColumnFilter.js +249 -0
- package/src/components/IxGridColumnFilter.js.map +1 -0
- package/src/components/IxGridDownloadMenu.d.ts +17 -0
- package/src/components/IxGridDownloadMenu.js +98 -0
- package/src/components/IxGridDownloadMenu.js.map +1 -0
- package/src/components/IxGridNav.d.ts +16 -0
- package/src/components/IxGridNav.js +103 -0
- package/src/components/IxGridNav.js.map +1 -0
- package/src/components/IxGridNoRows.d.ts +10 -0
- package/src/components/IxGridNoRows.js +74 -0
- package/src/components/IxGridNoRows.js.map +1 -0
- package/src/components/IxGridRowFilter.d.ts +55 -0
- package/src/components/IxGridRowFilter.js +441 -0
- package/src/components/IxGridRowFilter.js.map +1 -0
- package/src/components/IxPagination.d.ts +14 -0
- package/src/components/IxPagination.js +107 -0
- package/src/components/IxPagination.js.map +1 -0
- package/src/components/grid-column-filter-styles.d.ts +1 -0
- package/src/components/grid-column-filter-styles.js +89 -0
- package/src/components/grid-column-filter-styles.js.map +1 -0
- package/src/components/grid-row-filter-styles.d.ts +1 -0
- package/src/components/grid-row-filter-styles.js +311 -0
- package/src/components/grid-row-filter-styles.js.map +1 -0
- package/src/components/ix-grid-no-rows.d.ts +1 -0
- package/src/components/ix-grid-no-rows.js +2 -0
- package/src/components/ix-grid-no-rows.js.map +1 -0
- package/src/components/pagination-styles.d.ts +1 -0
- package/src/components/pagination-styles.js +84 -0
- package/src/components/pagination-styles.js.map +1 -0
- package/src/grid-view-styles.d.ts +1 -0
- package/src/grid-view-styles.js +283 -0
- package/src/grid-view-styles.js.map +1 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +3 -0
- package/src/index.js.map +1 -0
- package/src/ix-grid-copy.d.ts +12 -0
- package/src/ix-grid-copy.js +12 -0
- package/src/ix-grid-copy.js.map +1 -0
- package/src/ix-grid-nav.d.ts +1 -0
- package/src/ix-grid-nav.js +2 -0
- package/src/ix-grid-nav.js.map +1 -0
- package/src/ix-grid-no-rows.d.ts +1 -0
- package/src/ix-grid-no-rows.js +2 -0
- package/src/ix-grid-no-rows.js.map +1 -0
- package/src/ix-grid.d.ts +1 -0
- package/src/ix-grid.js +2 -0
- package/src/ix-grid.js.map +1 -0
- package/src/models/IxGridDownloadMenuItemModel.d.ts +7 -0
- package/src/models/IxGridDownloadMenuItemModel.js +1 -0
- package/src/models/IxGridDownloadMenuItemModel.js.map +1 -0
- package/src/test/ix-grid-column-filter.test.js +41 -0
- package/src/test/ix-grid-row-filter.test.js +281 -0
- package/src/test/ix-grid.test.js +391 -0
- package/src/test/ix-pagination.test.js +58 -0
- package/web-test-runner.config.mjs +1 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent ix-grid following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Digital Realty",
|
|
6
|
-
"version": "1.4.1-alpha.
|
|
6
|
+
"version": "1.4.1-alpha.2",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
".": "./dist/index.js",
|
|
12
12
|
"./ix-grid.js": "./dist/ix-grid.js",
|
|
13
13
|
"./ix-grid-nav.js": "./dist/ix-grid-nav.js",
|
|
14
|
-
"./ix-grid.min.js": "./dist/ix-grid.min.js",
|
|
15
14
|
"./ix-grid-no-rows.js": "./dist/ix-grid-no-rows.js",
|
|
16
15
|
"./IxGridNav": "./dist/IxGridNav.js"
|
|
17
16
|
},
|
|
@@ -46,11 +45,12 @@
|
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
47
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
49
|
-
"@digital-realty/ix-app-logic": "^1.2.2-alpha.
|
|
48
|
+
"@digital-realty/ix-app-logic": "^1.2.2-alpha.25",
|
|
50
49
|
"@open-wc/eslint-config": "^9.2.1",
|
|
51
50
|
"@open-wc/testing": "^3.1.6",
|
|
52
51
|
"@rollup/plugin-alias": "^5.1.1",
|
|
53
52
|
"@rollup/plugin-replace": "^6.0.2",
|
|
53
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
54
54
|
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
55
55
|
"@typescript-eslint/parser": "^5.48.0",
|
|
56
56
|
"@web/dev-server": "^0.4.6",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"rollup-plugin-uglify": "^6.0.4",
|
|
70
70
|
"sinon": "^19.0.2",
|
|
71
71
|
"tslib": "^2.3.1",
|
|
72
|
-
"typescript": "^4.5
|
|
72
|
+
"typescript": "^4.9.5"
|
|
73
73
|
},
|
|
74
74
|
"customElements": "custom-elements.json",
|
|
75
75
|
"eslintConfig": {
|
package/rollup.config.mjs
CHANGED
|
@@ -4,19 +4,45 @@ const minifyHTML = pkgMinifyHTML.default;
|
|
|
4
4
|
import summary from 'rollup-plugin-summary';
|
|
5
5
|
import { uglify } from "rollup-plugin-uglify";
|
|
6
6
|
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
7
|
-
import { rollUpExternals } from "@digital-realty/ix-app-logic/build_scripts/shared-deps.
|
|
7
|
+
import { rollUpExternals } from "@digital-realty/ix-app-logic/build_scripts/shared-deps.js";
|
|
8
|
+
import typescript from '@rollup/plugin-typescript';
|
|
8
9
|
|
|
10
|
+
// const sourceDir = './src';
|
|
11
|
+
// const outDir = './dist';
|
|
12
|
+
//
|
|
13
|
+
// export default {
|
|
14
|
+
// input: './src/index.ts',
|
|
15
|
+
// // input: {
|
|
16
|
+
// // 'ix-grid': `${sourceDir}/IxGrid.ts`,
|
|
17
|
+
// // 'ix-grid-nav': `${sourceDir}/components/IxGridNav.ts`,
|
|
18
|
+
// // 'ix-grid-no-rows': `${sourceDir}/components/IxGridNoRows.ts`,
|
|
19
|
+
// // },
|
|
20
|
+
// external: id => rollUpExternals(id),
|
|
21
|
+
// plugins: [
|
|
22
|
+
// typescript(),
|
|
23
|
+
// nodeResolve({
|
|
24
|
+
// exportConditions: ['browser', 'development'],
|
|
25
|
+
// browser: true,
|
|
26
|
+
// }),
|
|
27
|
+
// // Minify HTML template literals
|
|
28
|
+
// minifyHTML(),
|
|
29
|
+
// // Minify JS
|
|
30
|
+
// uglify(),
|
|
31
|
+
// // Print bundle summary
|
|
32
|
+
// summary(),
|
|
33
|
+
// ],
|
|
34
|
+
// output: {
|
|
35
|
+
// dir: outDir,
|
|
36
|
+
// entryFileNames: '[name].min.js',
|
|
37
|
+
// format: 'esm'
|
|
38
|
+
// },
|
|
39
|
+
// };
|
|
9
40
|
|
|
10
41
|
const target = './dist/ix-grid';
|
|
11
42
|
|
|
12
43
|
export default {
|
|
13
44
|
input: `${target}.js`,
|
|
14
|
-
external: id => rollUpExternals(id),
|
|
15
45
|
plugins: [
|
|
16
|
-
nodeResolve({
|
|
17
|
-
exportConditions: ['browser', 'development'],
|
|
18
|
-
browser: true,
|
|
19
|
-
}),
|
|
20
46
|
// Minify HTML template literals
|
|
21
47
|
minifyHTML(),
|
|
22
48
|
// Minify JS
|
package/src/IxGrid.d.ts
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import '@digital-realty/grid';
|
|
2
|
+
import type { GridItemModel } from '@digital-realty/grid';
|
|
3
|
+
import { GridColumn } from '@digital-realty/grid/src/vaadin-grid-column.js';
|
|
4
|
+
import '@digital-realty/ix-icon-button/ix-icon-button.js';
|
|
5
|
+
import '@digital-realty/ix-icon/ix-icon.js';
|
|
6
|
+
import '@digital-realty/ix-progress/ix-progress.js';
|
|
7
|
+
import { LitElement, nothing } from 'lit';
|
|
8
|
+
import './components/IxGridColumnFilter.js';
|
|
9
|
+
import './components/IxGridDownloadMenu.js';
|
|
10
|
+
import './components/IxGridRowFilter.js';
|
|
11
|
+
import './components/IxPagination.js';
|
|
12
|
+
import { IxGridDownloadMenuItemModel } from './models/IxGridDownloadMenuItemModel.js';
|
|
13
|
+
export interface Row {
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export type FilterOperator = 'equals' | 'contains';
|
|
17
|
+
export type DataType = 'string' | 'dateTime';
|
|
18
|
+
export type BodyRenderer = (item: any, model: GridItemModel<any>, column: GridColumn) => any;
|
|
19
|
+
export interface Column {
|
|
20
|
+
name: string;
|
|
21
|
+
header: string;
|
|
22
|
+
bodyRenderer: BodyRenderer;
|
|
23
|
+
width?: string;
|
|
24
|
+
sortable?: boolean;
|
|
25
|
+
filterable?: boolean;
|
|
26
|
+
hidden?: boolean;
|
|
27
|
+
frozenToEnd?: boolean;
|
|
28
|
+
dataType?: DataType;
|
|
29
|
+
filterOperators?: FilterOperator[];
|
|
30
|
+
autoWidth?: boolean;
|
|
31
|
+
minWidth?: string;
|
|
32
|
+
maxWidth?: string;
|
|
33
|
+
responsive?: [string, string][];
|
|
34
|
+
flexGrow?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface FieldOperator {
|
|
37
|
+
columnField: string;
|
|
38
|
+
operator: FilterOperator;
|
|
39
|
+
}
|
|
40
|
+
export declare class IxGrid extends LitElement {
|
|
41
|
+
static readonly styles: import("lit").CSSResult[];
|
|
42
|
+
private defaultPageSize;
|
|
43
|
+
private defaultPage;
|
|
44
|
+
private originalSearchParams;
|
|
45
|
+
grid: HTMLElement;
|
|
46
|
+
columnReorderingAllowed: boolean;
|
|
47
|
+
variantClass: string;
|
|
48
|
+
readonly columns: Column[];
|
|
49
|
+
rows: Row[];
|
|
50
|
+
defaultEmptyText: string;
|
|
51
|
+
sortedColumn: string;
|
|
52
|
+
sortDirection: string;
|
|
53
|
+
hideHeader: boolean;
|
|
54
|
+
hideFilters: boolean;
|
|
55
|
+
rowLimit: number;
|
|
56
|
+
page: number;
|
|
57
|
+
pageSize: number;
|
|
58
|
+
pageSizes: number[];
|
|
59
|
+
recordCount: number;
|
|
60
|
+
localStorageID: string | undefined;
|
|
61
|
+
showDownload: boolean;
|
|
62
|
+
isDownloading: boolean;
|
|
63
|
+
isLoading: boolean;
|
|
64
|
+
downloadMenuItems: IxGridDownloadMenuItemModel[];
|
|
65
|
+
addParamsToURL: boolean;
|
|
66
|
+
readParamsFromURL: boolean;
|
|
67
|
+
refreshDataOnColumnVisibilityChange: boolean;
|
|
68
|
+
filterValueChangeDebounceTime: number;
|
|
69
|
+
hideColumnHeaders: boolean;
|
|
70
|
+
preservedQueryParamKeys: string[];
|
|
71
|
+
filterMaxDate?: string;
|
|
72
|
+
hashedTableState: string;
|
|
73
|
+
hideViewMoreLessButtonIcon: boolean;
|
|
74
|
+
showAddButton: boolean;
|
|
75
|
+
disableAddButton: boolean;
|
|
76
|
+
addButtonLabel: string;
|
|
77
|
+
onAddButtonClick?: any;
|
|
78
|
+
showRemoveAllButton: boolean;
|
|
79
|
+
disableRemoveAllButton: boolean;
|
|
80
|
+
removeAllButtonLabel: string;
|
|
81
|
+
onRemoveAllButtonClick?: any;
|
|
82
|
+
private filters;
|
|
83
|
+
isColumnsReordering: boolean;
|
|
84
|
+
isExpanded: boolean;
|
|
85
|
+
displayColumns: Column[];
|
|
86
|
+
private defaultFilterKeys;
|
|
87
|
+
private initialised;
|
|
88
|
+
get isPersistable(): boolean;
|
|
89
|
+
get columnNames(): string[];
|
|
90
|
+
get columnsLocalStorageKey(): string;
|
|
91
|
+
get arrangedColumns(): {
|
|
92
|
+
width: string | undefined;
|
|
93
|
+
name: string;
|
|
94
|
+
header: string;
|
|
95
|
+
bodyRenderer: BodyRenderer;
|
|
96
|
+
sortable?: boolean | undefined;
|
|
97
|
+
filterable?: boolean | undefined;
|
|
98
|
+
hidden?: boolean | undefined;
|
|
99
|
+
frozenToEnd?: boolean | undefined;
|
|
100
|
+
dataType?: DataType | undefined;
|
|
101
|
+
filterOperators?: FilterOperator[] | undefined;
|
|
102
|
+
autoWidth?: boolean | undefined;
|
|
103
|
+
minWidth?: string | undefined;
|
|
104
|
+
maxWidth?: string | undefined;
|
|
105
|
+
responsive?: [string, string][] | undefined;
|
|
106
|
+
flexGrow?: number | undefined;
|
|
107
|
+
}[];
|
|
108
|
+
connectedCallback(): void;
|
|
109
|
+
disconnectedCallback(): void;
|
|
110
|
+
private handlePopState;
|
|
111
|
+
private updateSearchParamsFromUri;
|
|
112
|
+
private rebuildFiltersFromUri;
|
|
113
|
+
private dispatchChangeEvent;
|
|
114
|
+
update(changedProperties: Map<string, any>): void;
|
|
115
|
+
firstUpdated(): void;
|
|
116
|
+
private checkLocalStorageUpdate;
|
|
117
|
+
buildQueryFromFilters(): {
|
|
118
|
+
[k: string]: string;
|
|
119
|
+
};
|
|
120
|
+
rebuildQueryFromMatchingQuerystringParams(): Record<string, string>;
|
|
121
|
+
private getColumnsToDisplayFromLocalStorage;
|
|
122
|
+
private mapColumnsWithPersistedSettings;
|
|
123
|
+
private removeOldLocalStorageValues;
|
|
124
|
+
private findMatchingLocalStorageKeys;
|
|
125
|
+
private updatePage;
|
|
126
|
+
saveOriginalSearchParams(gridSearchParams: URLSearchParams): void;
|
|
127
|
+
handleSort(column?: string): void;
|
|
128
|
+
private renderColumnHeader;
|
|
129
|
+
setColumnsToLocalStorage(columns: Column[]): void;
|
|
130
|
+
reorderColumnsFromTable(): Promise<void>;
|
|
131
|
+
reorderColumnsFromFilter(e: CustomEvent): Promise<void>;
|
|
132
|
+
handleOnColumnFilter(e: CustomEvent): void;
|
|
133
|
+
cellPartNameGenerator(_column: Column, model: {
|
|
134
|
+
item: Row;
|
|
135
|
+
}): string;
|
|
136
|
+
private columnRenderer;
|
|
137
|
+
private renderHeader;
|
|
138
|
+
renderAddNewButton(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
139
|
+
get showViewMoreLessButton(): boolean;
|
|
140
|
+
renderViewMoreLessButton(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
141
|
+
renderRemoveAllButton(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
142
|
+
private renderRowControls;
|
|
143
|
+
private renderPaginationControls;
|
|
144
|
+
renderColumns(): import("lit-html").TemplateResult<1>;
|
|
145
|
+
renderLoading(): import("lit-html").TemplateResult<1>;
|
|
146
|
+
renderGrid(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
147
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
148
|
+
}
|