@digital-realty/ix-grid 1.0.38 → 2.0.0-alpha.0
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/IxGrid.d.ts +55 -55
- package/dist/IxGrid.js +219 -219
- package/dist/components/IxGridColumnFilter.d.ts +28 -28
- package/dist/components/IxGridColumnFilter.js +152 -152
- package/dist/components/IxGridDownloadMenu.d.ts +12 -12
- package/dist/components/IxGridDownloadMenu.js +35 -35
- package/dist/components/IxGridNav.d.ts +15 -15
- package/dist/components/IxGridNav.js +20 -20
- package/dist/components/IxGridRowFilter.d.ts +40 -40
- package/dist/components/IxGridRowFilter.js +188 -188
- package/dist/components/IxPagination.d.ts +13 -13
- package/dist/components/IxPagination.js +59 -59
- package/dist/components/grid-column-filter-styles.d.ts +1 -1
- package/dist/components/grid-column-filter-styles.js +2 -2
- package/dist/components/grid-download-menu-styles.d.ts +1 -1
- package/dist/components/grid-download-menu-styles.js +2 -2
- package/dist/components/grid-row-filter-styles.d.ts +1 -1
- package/dist/components/grid-row-filter-styles.js +2 -2
- package/dist/components/ix-grid-nav.d.ts +1 -1
- package/dist/components/ix-grid-nav.js +2 -2
- package/dist/components/pagination-styles.d.ts +1 -1
- package/dist/components/pagination-styles.js +2 -2
- package/dist/grid-view-styles.d.ts +1 -1
- package/dist/grid-view-styles.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/ix-grid-copy.d.ts +10 -10
- package/dist/ix-grid-copy.js +10 -10
- package/dist/ix-grid.d.ts +1 -1
- package/dist/ix-grid.js +2 -2
- package/dist/react/IxGridNav.d.ts +2 -2
- package/dist/react/IxGridNav.js +8 -8
- package/dist/test/ix-grid-column-filter.test.d.ts +1 -1
- package/dist/test/ix-grid-column-filter.test.js +35 -35
- package/dist/test/ix-grid-row-filter.test.d.ts +1 -1
- package/dist/test/ix-grid-row-filter.test.js +36 -36
- package/dist/test/ix-grid.test.d.ts +1 -1
- package/dist/test/ix-grid.test.js +42 -42
- package/dist/test/ix-pagination.test.d.ts +1 -1
- package/dist/test/ix-pagination.test.js +21 -21
- package/package.json +2 -3
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { LitElement, html } from 'lit';
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import '@digital-realty/ix-icon-button/ix-icon-button.js';
|
|
5
|
-
import '@digital-realty/ix-select/ix-select.js';
|
|
6
|
-
import { IxGridViewStyles } from '../grid-view-styles.js';
|
|
7
|
-
import { PaginationStyles } from './pagination-styles.js';
|
|
8
|
-
import { copy } from '../ix-grid-copy.js';
|
|
9
|
-
let IxPagination = class IxPagination extends LitElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.recordCount = 0;
|
|
13
|
-
this.page = 1;
|
|
14
|
-
this.pageSize = 10;
|
|
15
|
-
this.pageSizes = [5, 10, 25, 100];
|
|
16
|
-
}
|
|
17
|
-
changePage(offset) {
|
|
18
|
-
this.page += offset;
|
|
19
|
-
this.updatePagination();
|
|
20
|
-
}
|
|
21
|
-
updatePagination(page = this.page, pageSize = this.pageSize) {
|
|
22
|
-
this.dispatchEvent(new CustomEvent('updatePagination', {
|
|
23
|
-
detail: {
|
|
24
|
-
page,
|
|
25
|
-
pageSize,
|
|
26
|
-
},
|
|
27
|
-
bubbles: true,
|
|
28
|
-
composed: true,
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
render() {
|
|
32
|
-
const back = this.page > 1;
|
|
33
|
-
const next = this.recordCount > this.page * this.pageSize;
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import '@digital-realty/ix-icon-button/ix-icon-button.js';
|
|
5
|
+
import '@digital-realty/ix-select/ix-select.js';
|
|
6
|
+
import { IxGridViewStyles } from '../grid-view-styles.js';
|
|
7
|
+
import { PaginationStyles } from './pagination-styles.js';
|
|
8
|
+
import { copy } from '../ix-grid-copy.js';
|
|
9
|
+
let IxPagination = class IxPagination extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.recordCount = 0;
|
|
13
|
+
this.page = 1;
|
|
14
|
+
this.pageSize = 10;
|
|
15
|
+
this.pageSizes = [5, 10, 25, 100];
|
|
16
|
+
}
|
|
17
|
+
changePage(offset) {
|
|
18
|
+
this.page += offset;
|
|
19
|
+
this.updatePagination();
|
|
20
|
+
}
|
|
21
|
+
updatePagination(page = this.page, pageSize = this.pageSize) {
|
|
22
|
+
this.dispatchEvent(new CustomEvent('updatePagination', {
|
|
23
|
+
detail: {
|
|
24
|
+
page,
|
|
25
|
+
pageSize,
|
|
26
|
+
},
|
|
27
|
+
bubbles: true,
|
|
28
|
+
composed: true,
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
const back = this.page > 1;
|
|
33
|
+
const next = this.recordCount > this.page * this.pageSize;
|
|
34
34
|
return html ` <div class="pagination">
|
|
35
35
|
<p>${copy.rowsPerPage}:</p>
|
|
36
36
|
<ix-select
|
|
37
37
|
wide-menu
|
|
38
38
|
class="pagination__select-input"
|
|
39
|
-
@request-selection=${(e) => {
|
|
40
|
-
const el = e.target;
|
|
41
|
-
this.pageSize = Number(el.value);
|
|
42
|
-
this.updatePagination();
|
|
39
|
+
@request-selection=${(e) => {
|
|
40
|
+
const el = e.target;
|
|
41
|
+
this.pageSize = Number(el.value);
|
|
42
|
+
this.updatePagination();
|
|
43
43
|
}}
|
|
44
44
|
selected-index=${this.pageSizes.indexOf(this.pageSize)}
|
|
45
45
|
filled
|
|
@@ -52,8 +52,8 @@ let IxPagination = class IxPagination extends LitElement {
|
|
|
52
52
|
</ix-select>
|
|
53
53
|
<p>
|
|
54
54
|
${(this.page - 1) * this.pageSize + 1} -
|
|
55
|
-
${this.page * this.pageSize > this.recordCount
|
|
56
|
-
? html `${this.recordCount}`
|
|
55
|
+
${this.page * this.pageSize > this.recordCount
|
|
56
|
+
? html `${this.recordCount}`
|
|
57
57
|
: html `${this.page * this.pageSize}`}
|
|
58
58
|
of ${this.recordCount}
|
|
59
59
|
</p>
|
|
@@ -71,24 +71,24 @@ let IxPagination = class IxPagination extends LitElement {
|
|
|
71
71
|
>
|
|
72
72
|
</ix-icon-button>
|
|
73
73
|
</div>
|
|
74
|
-
</div>`;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
IxPagination.styles = [IxGridViewStyles, PaginationStyles];
|
|
78
|
-
__decorate([
|
|
79
|
-
property({ type: Number })
|
|
80
|
-
], IxPagination.prototype, "recordCount", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
property({ type: Number })
|
|
83
|
-
], IxPagination.prototype, "page", void 0);
|
|
84
|
-
__decorate([
|
|
85
|
-
property({ type: Number })
|
|
86
|
-
], IxPagination.prototype, "pageSize", void 0);
|
|
87
|
-
__decorate([
|
|
88
|
-
property({ type: Array })
|
|
89
|
-
], IxPagination.prototype, "pageSizes", void 0);
|
|
90
|
-
IxPagination = __decorate([
|
|
91
|
-
customElement('ix-pagination')
|
|
92
|
-
], IxPagination);
|
|
93
|
-
export { IxPagination };
|
|
74
|
+
</div>`;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
IxPagination.styles = [IxGridViewStyles, PaginationStyles];
|
|
78
|
+
__decorate([
|
|
79
|
+
property({ type: Number })
|
|
80
|
+
], IxPagination.prototype, "recordCount", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
property({ type: Number })
|
|
83
|
+
], IxPagination.prototype, "page", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
property({ type: Number })
|
|
86
|
+
], IxPagination.prototype, "pageSize", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
property({ type: Array })
|
|
89
|
+
], IxPagination.prototype, "pageSizes", void 0);
|
|
90
|
+
IxPagination = __decorate([
|
|
91
|
+
customElement('ix-pagination')
|
|
92
|
+
], IxPagination);
|
|
93
|
+
export { IxPagination };
|
|
94
94
|
//# sourceMappingURL=IxPagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const IxGridColumnFilterStyles: import("lit").CSSResult;
|
|
1
|
+
export declare const IxGridColumnFilterStyles: import("lit").CSSResult;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
1
|
+
import { css } from 'lit';
|
|
2
2
|
export const IxGridColumnFilterStyles = css `
|
|
3
3
|
.dropdown-content {
|
|
4
4
|
position: absolute;
|
|
@@ -97,5 +97,5 @@ export const IxGridColumnFilterStyles = css `
|
|
|
97
97
|
.list {
|
|
98
98
|
position: relative;
|
|
99
99
|
}
|
|
100
|
-
`;
|
|
100
|
+
`;
|
|
101
101
|
//# sourceMappingURL=grid-column-filter-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const IxGridDownloadMenuStyles: import("lit").CSSResult;
|
|
1
|
+
export declare const IxGridDownloadMenuStyles: import("lit").CSSResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const IxGridRowFilterStyles: import("lit").CSSResult;
|
|
1
|
+
export declare const IxGridRowFilterStyles: import("lit").CSSResult;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
1
|
+
import { css } from 'lit';
|
|
2
2
|
export const IxGridRowFilterStyles = css `
|
|
3
3
|
.slot-wrap {
|
|
4
4
|
display: flex;
|
|
@@ -438,5 +438,5 @@ export const IxGridRowFilterStyles = css `
|
|
|
438
438
|
align-items: center;
|
|
439
439
|
display: flex;
|
|
440
440
|
}
|
|
441
|
-
`;
|
|
441
|
+
`;
|
|
442
442
|
//# sourceMappingURL=grid-row-filter-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IxGridNavigation } from './IxGridNav.js';
|
|
2
|
-
window.customElements.define('ix-grid-nav', IxGridNavigation);
|
|
1
|
+
import { IxGridNavigation } from './IxGridNav.js';
|
|
2
|
+
window.customElements.define('ix-grid-nav', IxGridNavigation);
|
|
3
3
|
//# sourceMappingURL=ix-grid-nav.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PaginationStyles: import("lit").CSSResult;
|
|
1
|
+
export declare const PaginationStyles: import("lit").CSSResult;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
1
|
+
import { css } from 'lit';
|
|
2
2
|
export const PaginationStyles = css `
|
|
3
3
|
.pagination {
|
|
4
4
|
display: flex;
|
|
@@ -45,5 +45,5 @@ export const PaginationStyles = css `
|
|
|
45
45
|
ix-select-option {
|
|
46
46
|
--md-menu-item-selected-container-color: rgba(20, 86, 224, 0.1);
|
|
47
47
|
}
|
|
48
|
-
`;
|
|
48
|
+
`;
|
|
49
49
|
//# sourceMappingURL=pagination-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const IxGridViewStyles: import("lit").CSSResult;
|
|
1
|
+
export declare const IxGridViewStyles: import("lit").CSSResult;
|
package/dist/grid-view-styles.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
1
|
+
import { css } from 'lit';
|
|
2
2
|
export const IxGridViewStyles = css `
|
|
3
3
|
@font-face {
|
|
4
4
|
font-family: 'Material Icons';
|
|
@@ -207,5 +207,5 @@ export const IxGridViewStyles = css `
|
|
|
207
207
|
display: flex;
|
|
208
208
|
padding: 8px;
|
|
209
209
|
}
|
|
210
|
-
`;
|
|
210
|
+
`;
|
|
211
211
|
//# sourceMappingURL=grid-view-styles.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { IxGrid } from './IxGrid.js';
|
|
2
|
-
export { IxGridNavigation } from './components/IxGridNav.js';
|
|
1
|
+
export { IxGrid } from './IxGrid.js';
|
|
2
|
+
export { IxGridNavigation } from './components/IxGridNav.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { IxGrid } from './IxGrid.js';
|
|
2
|
-
export { IxGridNavigation } from './components/IxGridNav.js';
|
|
1
|
+
export { IxGrid } from './IxGrid.js';
|
|
2
|
+
export { IxGridNavigation } from './components/IxGridNav.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/ix-grid-copy.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare const copy: {
|
|
2
|
-
activeFilter: string;
|
|
3
|
-
filters: string;
|
|
4
|
-
hideFilters: string;
|
|
5
|
-
showFilters: string;
|
|
6
|
-
rowsPerPage: string;
|
|
7
|
-
user: string;
|
|
8
|
-
viewMore: string;
|
|
9
|
-
viewLess: string;
|
|
10
|
-
};
|
|
1
|
+
export declare const copy: {
|
|
2
|
+
activeFilter: string;
|
|
3
|
+
filters: string;
|
|
4
|
+
hideFilters: string;
|
|
5
|
+
showFilters: string;
|
|
6
|
+
rowsPerPage: string;
|
|
7
|
+
user: string;
|
|
8
|
+
viewMore: string;
|
|
9
|
+
viewLess: string;
|
|
10
|
+
};
|
package/dist/ix-grid-copy.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export const copy = {
|
|
2
|
-
activeFilter: 'active filter',
|
|
3
|
-
filters: 'Filters',
|
|
4
|
-
hideFilters: 'Hide Filters',
|
|
5
|
-
showFilters: 'Show Filters',
|
|
6
|
-
rowsPerPage: 'Rows per page',
|
|
7
|
-
user: 'user',
|
|
8
|
-
viewMore: 'VIEW MORE',
|
|
9
|
-
viewLess: 'VIEW LESS',
|
|
10
|
-
};
|
|
1
|
+
export const copy = {
|
|
2
|
+
activeFilter: 'active filter',
|
|
3
|
+
filters: 'Filters',
|
|
4
|
+
hideFilters: 'Hide Filters',
|
|
5
|
+
showFilters: 'Show Filters',
|
|
6
|
+
rowsPerPage: 'Rows per page',
|
|
7
|
+
user: 'user',
|
|
8
|
+
viewMore: 'VIEW MORE',
|
|
9
|
+
viewLess: 'VIEW LESS',
|
|
10
|
+
};
|
|
11
11
|
//# sourceMappingURL=ix-grid-copy.js.map
|
package/dist/ix-grid.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/ix-grid.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IxGrid } from './IxGrid.js';
|
|
2
|
-
window.customElements.define('ix-grid', IxGrid);
|
|
1
|
+
import { IxGrid } from './IxGrid.js';
|
|
2
|
+
window.customElements.define('ix-grid', IxGrid);
|
|
3
3
|
//# sourceMappingURL=ix-grid.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IxGridNavigation } from '../components/IxGridNav.js';
|
|
2
|
-
export declare const IxGridNav: import("@lit/react").ReactWebComponent<IxGridNavigation, {}>;
|
|
1
|
+
import { IxGridNavigation } from '../components/IxGridNav.js';
|
|
2
|
+
export declare const IxGridNav: import("@lit/react").ReactWebComponent<IxGridNavigation, {}>;
|
package/dist/react/IxGridNav.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createComponent } from '@lit/react';
|
|
3
|
-
import { IxGridNavigation } from '../components/IxGridNav.js';
|
|
4
|
-
export const IxGridNav = createComponent({
|
|
5
|
-
tagName: 'ix-grid-nav',
|
|
6
|
-
elementClass: IxGridNavigation,
|
|
7
|
-
react: React,
|
|
8
|
-
});
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { IxGridNavigation } from '../components/IxGridNav.js';
|
|
4
|
+
export const IxGridNav = createComponent({
|
|
5
|
+
tagName: 'ix-grid-nav',
|
|
6
|
+
elementClass: IxGridNavigation,
|
|
7
|
+
react: React,
|
|
8
|
+
});
|
|
9
9
|
//# sourceMappingURL=IxGridNav.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '../components/IxGridColumnFilter.js';
|
|
1
|
+
import '../components/IxGridColumnFilter.js';
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { fixture, expect, elementUpdated } from '@open-wc/testing';
|
|
3
|
-
import '../components/IxGridColumnFilter.js';
|
|
4
|
-
const columns = [
|
|
5
|
-
{
|
|
6
|
-
name: 'firstName',
|
|
7
|
-
header: 'First name',
|
|
8
|
-
hidden: false,
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
name: 'lastName',
|
|
12
|
-
header: 'Last name',
|
|
13
|
-
hidden: true,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'middleName',
|
|
17
|
-
header: 'Middle name',
|
|
18
|
-
hidden: false,
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
describe('IxGridColumnFilter', () => {
|
|
22
|
-
it('renders the grid column filter component', async () => {
|
|
23
|
-
const el = await fixture(html `<ix-grid-column-filter></ix-grid-column-filter>`);
|
|
24
|
-
expect(el).to.not.be.null;
|
|
25
|
-
});
|
|
26
|
-
it('renders the grid column filters list', async () => {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const el = await fixture(html `<ix-grid-column-filter .columns=${columns}></ix-grid-column-filter>`);
|
|
29
|
-
const list = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.list');
|
|
30
|
-
list.click();
|
|
31
|
-
await elementUpdated(el);
|
|
32
|
-
const options = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelectorAll('ix-switch');
|
|
33
|
-
expect(options === null || options === void 0 ? void 0 : options.length).to.equal(3);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { fixture, expect, elementUpdated } from '@open-wc/testing';
|
|
3
|
+
import '../components/IxGridColumnFilter.js';
|
|
4
|
+
const columns = [
|
|
5
|
+
{
|
|
6
|
+
name: 'firstName',
|
|
7
|
+
header: 'First name',
|
|
8
|
+
hidden: false,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'lastName',
|
|
12
|
+
header: 'Last name',
|
|
13
|
+
hidden: true,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'middleName',
|
|
17
|
+
header: 'Middle name',
|
|
18
|
+
hidden: false,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
describe('IxGridColumnFilter', () => {
|
|
22
|
+
it('renders the grid column filter component', async () => {
|
|
23
|
+
const el = await fixture(html `<ix-grid-column-filter></ix-grid-column-filter>`);
|
|
24
|
+
expect(el).to.not.be.null;
|
|
25
|
+
});
|
|
26
|
+
it('renders the grid column filters list', async () => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
const el = await fixture(html `<ix-grid-column-filter .columns=${columns}></ix-grid-column-filter>`);
|
|
29
|
+
const list = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.list');
|
|
30
|
+
list.click();
|
|
31
|
+
await elementUpdated(el);
|
|
32
|
+
const options = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelectorAll('ix-switch');
|
|
33
|
+
expect(options === null || options === void 0 ? void 0 : options.length).to.equal(3);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
36
|
//# sourceMappingURL=ix-grid-column-filter.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '../components/IxGridRowFilter.js';
|
|
1
|
+
import '../components/IxGridRowFilter.js';
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { fixture, expect, elementUpdated } from '@open-wc/testing';
|
|
3
|
-
import '../components/IxGridRowFilter.js';
|
|
4
|
-
const columns = [
|
|
5
|
-
{
|
|
6
|
-
name: 'firstName',
|
|
7
|
-
header: 'First name',
|
|
8
|
-
filterable: true,
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
name: 'lastName',
|
|
12
|
-
header: 'Last name',
|
|
13
|
-
filterable: true,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'middleName',
|
|
17
|
-
header: 'Middle name',
|
|
18
|
-
filterable: false,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'email',
|
|
22
|
-
header: 'Email',
|
|
23
|
-
filterable: true,
|
|
24
|
-
},
|
|
25
|
-
];
|
|
26
|
-
describe('IxGridRowFilter', () => {
|
|
27
|
-
it('renders and popluates the grid row filter', async () => {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
const el = await fixture(html `<ix-grid-row-filter .columns=${columns}></ix-grid-row-filter>`);
|
|
30
|
-
const openMenu = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.filter-button');
|
|
31
|
-
openMenu.click();
|
|
32
|
-
await elementUpdated(el);
|
|
33
|
-
const options = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelectorAll('select[data-v="firstName"] option');
|
|
34
|
-
expect(options === null || options === void 0 ? void 0 : options.length).to.equal(3);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { fixture, expect, elementUpdated } from '@open-wc/testing';
|
|
3
|
+
import '../components/IxGridRowFilter.js';
|
|
4
|
+
const columns = [
|
|
5
|
+
{
|
|
6
|
+
name: 'firstName',
|
|
7
|
+
header: 'First name',
|
|
8
|
+
filterable: true,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'lastName',
|
|
12
|
+
header: 'Last name',
|
|
13
|
+
filterable: true,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'middleName',
|
|
17
|
+
header: 'Middle name',
|
|
18
|
+
filterable: false,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'email',
|
|
22
|
+
header: 'Email',
|
|
23
|
+
filterable: true,
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
describe('IxGridRowFilter', () => {
|
|
27
|
+
it('renders and popluates the grid row filter', async () => {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const el = await fixture(html `<ix-grid-row-filter .columns=${columns}></ix-grid-row-filter>`);
|
|
30
|
+
const openMenu = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.filter-button');
|
|
31
|
+
openMenu.click();
|
|
32
|
+
await elementUpdated(el);
|
|
33
|
+
const options = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelectorAll('select[data-v="firstName"] option');
|
|
34
|
+
expect(options === null || options === void 0 ? void 0 : options.length).to.equal(3);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
37
|
//# sourceMappingURL=ix-grid-row-filter.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '../ix-grid.js';
|
|
1
|
+
import '../ix-grid.js';
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { fixture, expect } from '@open-wc/testing';
|
|
3
|
-
import '../ix-grid.js';
|
|
4
|
-
const rows = [
|
|
5
|
-
{
|
|
6
|
-
name: 'one',
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
name: 'two',
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
name: 'three',
|
|
13
|
-
},
|
|
14
|
-
];
|
|
15
|
-
const columns = [
|
|
16
|
-
{
|
|
17
|
-
name: 'one',
|
|
18
|
-
header: 'one',
|
|
19
|
-
bodyRenderer: row => html ` <span>${row.name}</span>`,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'two',
|
|
23
|
-
header: 'one',
|
|
24
|
-
bodyRenderer: row => html ` <span>${row.name}</span>`,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'three',
|
|
28
|
-
header: 'one',
|
|
29
|
-
bodyRenderer: row => html ` <span>${row.name}</span>`,
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
describe('IxGrid', () => {
|
|
33
|
-
it('renders a grid', async () => {
|
|
34
|
-
const el = await fixture(html `<ix-grid></ix-grid>`);
|
|
35
|
-
expect(el).to.not.be.null;
|
|
36
|
-
});
|
|
37
|
-
it('renders the correct number of rows', async () => {
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { fixture, expect } from '@open-wc/testing';
|
|
3
|
+
import '../ix-grid.js';
|
|
4
|
+
const rows = [
|
|
5
|
+
{
|
|
6
|
+
name: 'one',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'two',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'three',
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
const columns = [
|
|
16
|
+
{
|
|
17
|
+
name: 'one',
|
|
18
|
+
header: 'one',
|
|
19
|
+
bodyRenderer: row => html ` <span>${row.name}</span>`,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'two',
|
|
23
|
+
header: 'one',
|
|
24
|
+
bodyRenderer: row => html ` <span>${row.name}</span>`,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'three',
|
|
28
|
+
header: 'one',
|
|
29
|
+
bodyRenderer: row => html ` <span>${row.name}</span>`,
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
describe('IxGrid', () => {
|
|
33
|
+
it('renders a grid', async () => {
|
|
34
|
+
const el = await fixture(html `<ix-grid></ix-grid>`);
|
|
35
|
+
expect(el).to.not.be.null;
|
|
36
|
+
});
|
|
37
|
+
it('renders the correct number of rows', async () => {
|
|
38
38
|
const el = await fixture(html `<ix-grid
|
|
39
39
|
.columns=${columns}
|
|
40
40
|
.rows=${rows}
|
|
41
|
-
></ix-grid>`);
|
|
42
|
-
expect(rows.length).to.equal(3);
|
|
43
|
-
expect(el).to.not.be.null;
|
|
44
|
-
});
|
|
45
|
-
});
|
|
41
|
+
></ix-grid>`);
|
|
42
|
+
expect(rows.length).to.equal(3);
|
|
43
|
+
expect(el).to.not.be.null;
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
46
|
//# sourceMappingURL=ix-grid.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '../components/IxPagination.js';
|
|
1
|
+
import '../components/IxPagination.js';
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import { fixture, expect } from '@open-wc/testing';
|
|
3
|
-
import '../components/IxPagination.js';
|
|
4
|
-
describe('IxPagination', () => {
|
|
5
|
-
it('renders pagination', async () => {
|
|
6
|
-
const el = await fixture(html `<ix-pagination></ix-pagination>`);
|
|
7
|
-
expect(el).to.not.be.null;
|
|
8
|
-
});
|
|
9
|
-
it('renders pagination page size select', async () => {
|
|
10
|
-
var _a;
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { fixture, expect } from '@open-wc/testing';
|
|
3
|
+
import '../components/IxPagination.js';
|
|
4
|
+
describe('IxPagination', () => {
|
|
5
|
+
it('renders pagination', async () => {
|
|
6
|
+
const el = await fixture(html `<ix-pagination></ix-pagination>`);
|
|
7
|
+
expect(el).to.not.be.null;
|
|
8
|
+
});
|
|
9
|
+
it('renders pagination page size select', async () => {
|
|
10
|
+
var _a;
|
|
11
11
|
const el = await fixture(html `<ix-pagination
|
|
12
12
|
.pageSizes=${[1, 2, 3]}
|
|
13
|
-
></ix-pagination>`);
|
|
14
|
-
const pageSizeSelect = (_a = el === null || el === void 0 ? void 0 : el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('ix-select-option');
|
|
15
|
-
expect(pageSizeSelect === null || pageSizeSelect === void 0 ? void 0 : pageSizeSelect.length).to.equal(3);
|
|
16
|
-
});
|
|
17
|
-
it('renders pagination range info', async () => {
|
|
18
|
-
var _a;
|
|
13
|
+
></ix-pagination>`);
|
|
14
|
+
const pageSizeSelect = (_a = el === null || el === void 0 ? void 0 : el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('ix-select-option');
|
|
15
|
+
expect(pageSizeSelect === null || pageSizeSelect === void 0 ? void 0 : pageSizeSelect.length).to.equal(3);
|
|
16
|
+
});
|
|
17
|
+
it('renders pagination range info', async () => {
|
|
18
|
+
var _a;
|
|
19
19
|
const el = await fixture(html `<ix-pagination
|
|
20
20
|
pageSize="10"
|
|
21
21
|
page="2"
|
|
22
22
|
recordCount="99"
|
|
23
|
-
></ix-pagination>`);
|
|
24
|
-
const pageRangeInfo = (_a = el === null || el === void 0 ? void 0 : el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('p')[1];
|
|
25
|
-
expect(pageRangeInfo === null || pageRangeInfo === void 0 ? void 0 : pageRangeInfo.innerText).to.equal('11 - 20 of 99');
|
|
26
|
-
});
|
|
27
|
-
});
|
|
23
|
+
></ix-pagination>`);
|
|
24
|
+
const pageRangeInfo = (_a = el === null || el === void 0 ? void 0 : el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('p')[1];
|
|
25
|
+
expect(pageRangeInfo === null || pageRangeInfo === void 0 ? void 0 : pageRangeInfo.innerText).to.equal('11 - 20 of 99');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
28
|
//# sourceMappingURL=ix-pagination.test.js.map
|