@eox/itemfilter 0.0.1 → 0.1.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/eox-itemfilter.js +1079 -1107
- package/dist/eox-itemfilter.umd.cjs +159 -1221
- package/package.json +1 -1
- package/test/general.cy.ts +11 -1
- package/test/general.html +8 -2
- package/test/reducedWidth.cy.ts +32 -0
package/package.json
CHANGED
package/test/general.cy.ts
CHANGED
|
@@ -9,7 +9,17 @@ describe("Item Filter", () => {
|
|
|
9
9
|
it("loads the itemfilter", () => {
|
|
10
10
|
cy.get("eox-itemfilter").should(($el) => {
|
|
11
11
|
const EOxItemFilter = <EOxItemFilter>$el[0];
|
|
12
|
-
EOxItemFilter.
|
|
12
|
+
EOxItemFilter.config = {
|
|
13
|
+
filterProperties: ["themes"],
|
|
14
|
+
aggregateResults: "themes",
|
|
15
|
+
enableSearch: true,
|
|
16
|
+
// enableHighlighting: false,
|
|
17
|
+
// onSelect: (item: any) => {
|
|
18
|
+
// console.log(item);
|
|
19
|
+
// },
|
|
20
|
+
// matchAllWhenEmpty: true,
|
|
21
|
+
// exclusiveFilters: true,
|
|
22
|
+
};
|
|
13
23
|
EOxItemFilter.apply(testItems);
|
|
14
24
|
});
|
|
15
25
|
});
|
package/test/general.html
CHANGED
|
@@ -3,14 +3,20 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<style>
|
|
5
5
|
html,
|
|
6
|
-
body
|
|
6
|
+
body,
|
|
7
|
+
eox-itemfilter {
|
|
7
8
|
padding: 0;
|
|
8
9
|
margin: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
9
12
|
}
|
|
10
13
|
</style>
|
|
11
14
|
<script type="module" defer src="../dist/eox-itemfilter.js"></script>
|
|
12
15
|
</head>
|
|
13
16
|
<body>
|
|
14
|
-
<eox-itemfilter
|
|
17
|
+
<eox-itemfilter>
|
|
18
|
+
<h4 slot="filterstitle">Filter</h4>
|
|
19
|
+
<h4 slot="resultstitle">Results</h4>
|
|
20
|
+
</eox-itemfilter>
|
|
15
21
|
</body>
|
|
16
22
|
</html>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EOxItemFilter } from "../src/main";
|
|
2
|
+
import testItems from "./testItems.json";
|
|
3
|
+
|
|
4
|
+
describe("Item Filter", () => {
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
cy.visit("/elements/itemfilter/test/general.html");
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it("loads the itemfilter", () => {
|
|
10
|
+
cy.get("eox-itemfilter").should(($el) => {
|
|
11
|
+
const EOxItemFilter = <EOxItemFilter>$el[0];
|
|
12
|
+
EOxItemFilter.config = {
|
|
13
|
+
filterProperties: ["themes"],
|
|
14
|
+
aggregateResults: "themes",
|
|
15
|
+
enableSearch: true,
|
|
16
|
+
};
|
|
17
|
+
EOxItemFilter.apply(testItems);
|
|
18
|
+
});
|
|
19
|
+
cy.viewport(800, 700);
|
|
20
|
+
cy.wait(2000);
|
|
21
|
+
cy.viewport(600, 700);
|
|
22
|
+
cy.wait(2000);
|
|
23
|
+
cy.viewport(400, 700);
|
|
24
|
+
cy.wait(2000);
|
|
25
|
+
cy.viewport(800, 400);
|
|
26
|
+
cy.wait(2000);
|
|
27
|
+
cy.viewport(600, 400);
|
|
28
|
+
cy.wait(2000);
|
|
29
|
+
cy.viewport(400, 400);
|
|
30
|
+
cy.wait(2000);
|
|
31
|
+
});
|
|
32
|
+
});
|