@vaadin/component-base 24.5.0-alpha8 → 24.5.0-beta1
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/README.md +1 -1
- package/package.json +3 -3
- package/src/define.js +1 -1
- package/src/media-query-controller.d.ts +0 -3
- package/src/url-utils.js +8 -6
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A set of helpers and mixins used by Vaadin components.
|
|
|
4
4
|
|
|
5
5
|
## Contributing
|
|
6
6
|
|
|
7
|
-
Read the [contributing guide](https://vaadin.com/docs/latest/contributing
|
|
7
|
+
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
|
8
8
|
|
|
9
9
|
## License
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/component-base",
|
|
3
|
-
"version": "24.5.0-
|
|
3
|
+
"version": "24.5.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"lit": "^3.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@vaadin/chai-plugins": "24.5.0-
|
|
41
|
+
"@vaadin/chai-plugins": "24.5.0-beta1",
|
|
42
42
|
"@vaadin/testing-helpers": "^1.0.0",
|
|
43
43
|
"sinon": "^18.0.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "da4b57724d7089e3766d59d01068159322adb2b8"
|
|
46
46
|
}
|
package/src/define.js
CHANGED
|
@@ -19,9 +19,6 @@ export class MediaQueryController implements ReactiveController {
|
|
|
19
19
|
*/
|
|
20
20
|
protected callback: (matches: boolean) => void;
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* @param {HTMLElement} host
|
|
24
|
-
*/
|
|
25
22
|
constructor(query: string, callback: (matches: boolean) => void);
|
|
26
23
|
|
|
27
24
|
hostConnected(): void;
|
package/src/url-utils.js
CHANGED
|
@@ -27,15 +27,17 @@ function containsQueryParams(actual, expected) {
|
|
|
27
27
|
*
|
|
28
28
|
* @param {string} actual The actual URL to match.
|
|
29
29
|
* @param {string} expected The expected URL to match.
|
|
30
|
+
* @param {Object} matchOptions Options for path matching.
|
|
30
31
|
*/
|
|
31
|
-
export function matchPaths(actual, expected) {
|
|
32
|
+
export function matchPaths(actual, expected, matchOptions = { matchNested: false }) {
|
|
32
33
|
const base = document.baseURI;
|
|
33
34
|
const actualUrl = new URL(actual, base);
|
|
34
35
|
const expectedUrl = new URL(expected, base);
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
actualUrl.pathname === expectedUrl.pathname
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const matchesOrigin = actualUrl.origin === expectedUrl.origin;
|
|
38
|
+
const matchesPath = matchOptions.matchNested
|
|
39
|
+
? actualUrl.pathname === expectedUrl.pathname || actualUrl.pathname.startsWith(`${expectedUrl.pathname}/`)
|
|
40
|
+
: actualUrl.pathname === expectedUrl.pathname;
|
|
41
|
+
|
|
42
|
+
return matchesOrigin && matchesPath && containsQueryParams(actualUrl.searchParams, expectedUrl.searchParams);
|
|
41
43
|
}
|