@vaadin/side-nav 24.8.0-alpha1 → 24.8.0-alpha11
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/side-nav",
|
|
3
|
-
"version": "24.8.0-
|
|
3
|
+
"version": "24.8.0-alpha11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "24.8.0-
|
|
39
|
-
"@vaadin/component-base": "24.8.0-
|
|
40
|
-
"@vaadin/vaadin-lumo-styles": "24.8.0-
|
|
41
|
-
"@vaadin/vaadin-material-styles": "24.8.0-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "24.8.0-
|
|
38
|
+
"@vaadin/a11y-base": "24.8.0-alpha11",
|
|
39
|
+
"@vaadin/component-base": "24.8.0-alpha11",
|
|
40
|
+
"@vaadin/vaadin-lumo-styles": "24.8.0-alpha11",
|
|
41
|
+
"@vaadin/vaadin-material-styles": "24.8.0-alpha11",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha11",
|
|
43
43
|
"lit": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@vaadin/chai-plugins": "24.8.0-
|
|
47
|
-
"@vaadin/test-runner-commands": "24.8.0-
|
|
46
|
+
"@vaadin/chai-plugins": "24.8.0-alpha11",
|
|
47
|
+
"@vaadin/test-runner-commands": "24.8.0-alpha11",
|
|
48
48
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
49
49
|
"lit": "^3.0.0",
|
|
50
50
|
"sinon": "^18.0.0"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"web-types.json",
|
|
54
54
|
"web-types.lit.json"
|
|
55
55
|
],
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "be9c2d59f4b63ae58e85ccb3dfb78d5af2d2ac8a"
|
|
57
57
|
}
|
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
+
import type { I18nMixinClass } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
7
8
|
|
|
8
9
|
export interface SideNavI18n {
|
|
9
|
-
toggle
|
|
10
|
+
toggle?: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export declare function SideNavChildrenMixin<T extends Constructor<HTMLElement>>(
|
|
13
14
|
base: T,
|
|
14
|
-
): Constructor<SideNavChildrenMixinClass> & T;
|
|
15
|
+
): Constructor<SideNavChildrenMixinClass> & Constructor<I18nMixinClass<SideNavI18n>> & T;
|
|
15
16
|
|
|
16
17
|
export declare class SideNavChildrenMixinClass {
|
|
17
18
|
/**
|
|
18
|
-
* The object used to localize this component.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* `i18n` object with a custom one.
|
|
19
|
+
* The object used to localize this component. To change the default
|
|
20
|
+
* localization, replace this with an object that provides all properties, or
|
|
21
|
+
* just the individual properties you want to change.
|
|
22
22
|
*
|
|
23
23
|
* The object has the following structure and default values:
|
|
24
24
|
* ```
|
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
* Copyright (c) 2023 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
6
7
|
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
7
8
|
|
|
9
|
+
const DEFAULT_I18N = {
|
|
10
|
+
toggle: 'Toggle child items',
|
|
11
|
+
};
|
|
12
|
+
|
|
8
13
|
/**
|
|
9
14
|
* A controller that manages the item content children slot.
|
|
10
15
|
*/
|
|
@@ -34,34 +39,9 @@ class ChildrenController extends SlotController {
|
|
|
34
39
|
* @polymerMixin
|
|
35
40
|
*/
|
|
36
41
|
export const SideNavChildrenMixin = (superClass) =>
|
|
37
|
-
class SideNavChildrenMixin extends superClass {
|
|
42
|
+
class SideNavChildrenMixin extends I18nMixin(DEFAULT_I18N, superClass) {
|
|
38
43
|
static get properties() {
|
|
39
44
|
return {
|
|
40
|
-
/**
|
|
41
|
-
* The object used to localize this component.
|
|
42
|
-
*
|
|
43
|
-
* To change the default localization, replace the entire
|
|
44
|
-
* `i18n` object with a custom one.
|
|
45
|
-
*
|
|
46
|
-
* The object has the following structure and default values:
|
|
47
|
-
* ```
|
|
48
|
-
* {
|
|
49
|
-
* toggle: 'Toggle child items'
|
|
50
|
-
* }
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* @type {SideNavI18n}
|
|
54
|
-
* @default {English/US}
|
|
55
|
-
*/
|
|
56
|
-
i18n: {
|
|
57
|
-
type: Object,
|
|
58
|
-
value: () => {
|
|
59
|
-
return {
|
|
60
|
-
toggle: 'Toggle child items',
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
|
|
65
45
|
/**
|
|
66
46
|
* Count of child items.
|
|
67
47
|
* @protected
|
|
@@ -79,6 +59,27 @@ export const SideNavChildrenMixin = (superClass) =>
|
|
|
79
59
|
this._childrenController = new ChildrenController(this, this._itemsSlotName);
|
|
80
60
|
}
|
|
81
61
|
|
|
62
|
+
/**
|
|
63
|
+
* The object used to localize this component. To change the default
|
|
64
|
+
* localization, replace this with an object that provides all properties, or
|
|
65
|
+
* just the individual properties you want to change.
|
|
66
|
+
*
|
|
67
|
+
* The object has the following structure and default values:
|
|
68
|
+
* ```
|
|
69
|
+
* {
|
|
70
|
+
* toggle: 'Toggle child items'
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
* @return {!SideNavI18n}
|
|
74
|
+
*/
|
|
75
|
+
get i18n() {
|
|
76
|
+
return super.i18n;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
set i18n(value) {
|
|
80
|
+
super.i18n = value;
|
|
81
|
+
}
|
|
82
|
+
|
|
82
83
|
/**
|
|
83
84
|
* List of child items of this component.
|
|
84
85
|
* @protected
|
|
@@ -125,9 +126,9 @@ export const SideNavChildrenMixin = (superClass) =>
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
// Propagate i18n object to all the child items
|
|
128
|
-
if (props.has('_itemsCount') || props.has('
|
|
129
|
+
if (props.has('_itemsCount') || props.has('__effectiveI18n')) {
|
|
129
130
|
this._items.forEach((item) => {
|
|
130
|
-
item.i18n = this.
|
|
131
|
+
item.i18n = this.__effectiveI18n;
|
|
131
132
|
});
|
|
132
133
|
}
|
|
133
134
|
}
|
|
@@ -270,7 +270,7 @@ class SideNavItem extends SideNavChildrenMixin(DisabledMixin(ElementMixin(Themab
|
|
|
270
270
|
<ul part="children" role="list" ?hidden="${!this.expanded}" aria-hidden="${this.expanded ? 'false' : 'true'}">
|
|
271
271
|
<slot name="children"></slot>
|
|
272
272
|
</ul>
|
|
273
|
-
<div hidden id="i18n">${this.
|
|
273
|
+
<div hidden id="i18n">${this.__effectiveI18n.toggle}</div>
|
|
274
274
|
`;
|
|
275
275
|
}
|
|
276
276
|
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/side-nav",
|
|
4
|
-
"version": "24.8.0-
|
|
4
|
+
"version": "24.8.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"name": "i18n",
|
|
100
|
-
"description": "The object used to localize this component
|
|
100
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following structure and default values:\n```\n{\n toggle: 'Toggle child items'\n}\n```",
|
|
101
101
|
"value": {
|
|
102
102
|
"type": [
|
|
103
103
|
"SideNavI18n"
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
"properties": [
|
|
229
229
|
{
|
|
230
230
|
"name": "i18n",
|
|
231
|
-
"description": "The object used to localize this component
|
|
231
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following structure and default values:\n```\n{\n toggle: 'Toggle child items'\n}\n```",
|
|
232
232
|
"value": {
|
|
233
233
|
"type": [
|
|
234
234
|
"SideNavI18n"
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/side-nav",
|
|
4
|
-
"version": "24.8.0-
|
|
4
|
+
"version": "24.8.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"name": ".i18n",
|
|
52
|
-
"description": "The object used to localize this component
|
|
52
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following structure and default values:\n```\n{\n toggle: 'Toggle child items'\n}\n```",
|
|
53
53
|
"value": {
|
|
54
54
|
"kind": "expression"
|
|
55
55
|
}
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
"name": ".i18n",
|
|
115
|
-
"description": "The object used to localize this component
|
|
115
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following structure and default values:\n```\n{\n toggle: 'Toggle child items'\n}\n```",
|
|
116
116
|
"value": {
|
|
117
117
|
"kind": "expression"
|
|
118
118
|
}
|