@kubex/zinc 1.0.22 → 1.0.24
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/custom-elements.json +21 -3
- package/dist/vscode.html-custom-data.json +1 -0
- package/dist/web-types.json +7 -2
- package/dist/zn.d.ts +3 -2
- package/dist/zn.min.js +43 -41
- package/package.json +1 -1
- package/src/components/input-group/input-group.scss +1 -0
- package/src/components/item/item.component.ts +1 -1
- package/src/components/navbar/navbar.component.ts +5 -4
- package/src/components/translations/translations.component.ts +20 -18
- package/src/components/translations/translations.scss +27 -1
package/package.json
CHANGED
|
@@ -52,7 +52,7 @@ export default class ZnItem extends ZincElement {
|
|
|
52
52
|
@property({type: Boolean, attribute: 'align-end'}) alignEnd: boolean;
|
|
53
53
|
|
|
54
54
|
// align items in the center
|
|
55
|
-
@property({type: Boolean, attribute: 'align-center'})
|
|
55
|
+
@property({type: Boolean, attribute: 'align-center'}) alignCenter: boolean;
|
|
56
56
|
|
|
57
57
|
connectedCallback() {
|
|
58
58
|
super.connectedCallback();
|
|
@@ -224,7 +224,7 @@ export default class ZnNavbar extends ZincElement {
|
|
|
224
224
|
'navbar__container--stacked': this.stacked,
|
|
225
225
|
'navbar__container--icon-bar': this.iconBar
|
|
226
226
|
})}">
|
|
227
|
-
<ul @click="${this.handleClick}" class="${classMap({
|
|
227
|
+
<ul @click="${this.handleClick}" part="navbar" class="${classMap({
|
|
228
228
|
'navbar': true,
|
|
229
229
|
'navbar--slim': this.slim,
|
|
230
230
|
'navbar--border': this.border,
|
|
@@ -242,10 +242,11 @@ export default class ZnNavbar extends ZincElement {
|
|
|
242
242
|
}
|
|
243
243
|
if (item.path != undefined) {
|
|
244
244
|
return html`
|
|
245
|
-
<li class="${classMap({'active': item.active})}" tab-uri="${item.path}">${content}</li>`;
|
|
245
|
+
<li class="${classMap({'active': item.active})}" part="navbar-item" tab-uri="${item.path}">${content}</li>`;
|
|
246
246
|
}
|
|
247
247
|
return html`
|
|
248
|
-
<li class="${classMap({'active': item.active})}"
|
|
248
|
+
<li class="${classMap({ 'active': item.active })}"
|
|
249
|
+
part="navbar-item"
|
|
249
250
|
tab="${ifDefined(!this.isolated ? item.tab : undefined)}"
|
|
250
251
|
data-tab="${ifDefined(this.isolated ? item.tab : undefined)}">
|
|
251
252
|
${content}
|
|
@@ -263,7 +264,7 @@ export default class ZnNavbar extends ZincElement {
|
|
|
263
264
|
${this.dropdown && this.dropdown.length > 0 ? html`
|
|
264
265
|
<li id="dropdown-item">
|
|
265
266
|
<zn-dropdown>
|
|
266
|
-
<zn-button slot="trigger" color="secondary" square grow>
|
|
267
|
+
<zn-button slot="trigger" part="button" exportparts="base:button__base" color="secondary" square grow>
|
|
267
268
|
<zn-icon src="add" size="18"></zn-icon>
|
|
268
269
|
</zn-button>
|
|
269
270
|
<zn-menu actions="${JSON.stringify(this.dropdown)}"></zn-menu>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {classMap} from 'lit/directives/class-map.js';
|
|
2
|
-
import {FormControlController, validValidityState} from '../../internal/form';
|
|
3
|
-
import {HasSlotController} from '../../internal/slot';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
2
|
+
import { FormControlController, validValidityState } from '../../internal/form';
|
|
3
|
+
import { HasSlotController } from '../../internal/slot';
|
|
4
|
+
import type { PropertyValues } from 'lit';
|
|
5
|
+
import { html, nothing, unsafeCSS } from 'lit';
|
|
6
|
+
import { property, state } from 'lit/decorators.js';
|
|
7
|
+
import type { ZincFormControl } from '../../internal/zinc-element';
|
|
6
8
|
import ZincElement from '../../internal/zinc-element';
|
|
7
9
|
import ZnInlineEdit from '../inline-edit';
|
|
8
10
|
import ZnInput from '../input';
|
|
9
11
|
import ZnNavbar from '../navbar';
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type {ZnMenuSelectEvent} from '../../events/zn-menu-select';
|
|
13
|
-
import type {ZnSelectEvent} from "../../events/zn-select";
|
|
12
|
+
import type { ZnMenuSelectEvent } from '../../events/zn-menu-select';
|
|
13
|
+
import type { ZnSelectEvent } from "../../events/zn-select";
|
|
14
14
|
|
|
15
15
|
import styles from './translations.scss';
|
|
16
16
|
|
|
@@ -28,13 +28,14 @@ export default class ZnTranslations extends ZincElement implements ZincFormContr
|
|
|
28
28
|
@property() name = '';
|
|
29
29
|
@property() value = '{"en":""}';
|
|
30
30
|
@property() label: string = '';
|
|
31
|
-
@property({type: Boolean, reflect: true}) disabled = false;
|
|
32
|
-
@property({type: Boolean, reflect: true}) required = false;
|
|
31
|
+
@property({ type: Boolean, reflect: true }) disabled = false;
|
|
32
|
+
@property({ type: Boolean, reflect: true }) required = false;
|
|
33
|
+
@property({ type: Boolean, reflect: true }) flush = false;
|
|
33
34
|
|
|
34
|
-
@property({type: Object}) languages: Record<string, string> = {
|
|
35
|
-
'en': '
|
|
35
|
+
@property({ type: Object }) languages: Record<string, string> = {
|
|
36
|
+
'en': 'EN'
|
|
36
37
|
};
|
|
37
|
-
@property({type: Object}) values: Record<string, string> = {};
|
|
38
|
+
@property({ type: Object }) values: Record<string, string> = {};
|
|
38
39
|
|
|
39
40
|
@state() private _activeLanguage = 'en';
|
|
40
41
|
|
|
@@ -116,7 +117,7 @@ export default class ZnTranslations extends ZincElement implements ZincFormContr
|
|
|
116
117
|
const languageCode = element.getAttribute('data-path');
|
|
117
118
|
if (languageCode) {
|
|
118
119
|
// Add new language with empty string
|
|
119
|
-
this.values = {...this.values, [languageCode]: ''};
|
|
120
|
+
this.values = { ...this.values, [languageCode]: '' };
|
|
120
121
|
this._activeLanguage = languageCode;
|
|
121
122
|
this.updateValue();
|
|
122
123
|
}
|
|
@@ -139,7 +140,7 @@ export default class ZnTranslations extends ZincElement implements ZincFormContr
|
|
|
139
140
|
if (this._activeLanguage) {
|
|
140
141
|
const newValue: string = target.value as string;
|
|
141
142
|
if (newValue !== this.values[this._activeLanguage]) {
|
|
142
|
-
this.values = {...this.values, [this._activeLanguage]: newValue};
|
|
143
|
+
this.values = { ...this.values, [this._activeLanguage]: newValue };
|
|
143
144
|
this.updateValue();
|
|
144
145
|
}
|
|
145
146
|
}
|
|
@@ -184,7 +185,7 @@ export default class ZnTranslations extends ZincElement implements ZincFormContr
|
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
const navigation = visibleTabs.map(code => ({
|
|
187
|
-
title:
|
|
188
|
+
title: code.toUpperCase(),
|
|
188
189
|
active: code === this._activeLanguage,
|
|
189
190
|
tab: code
|
|
190
191
|
}));
|
|
@@ -212,9 +213,10 @@ export default class ZnTranslations extends ZincElement implements ZincFormContr
|
|
|
212
213
|
.navigation="${navigation}"
|
|
213
214
|
.dropdown="${availableLanguages}"
|
|
214
215
|
name="${this.name}-translations-navbar"
|
|
215
|
-
isolated
|
|
216
216
|
@zn-select="${this.handleNavbarClick}"
|
|
217
217
|
@zn-menu-select="${this.handleLanguageAdd}"
|
|
218
|
+
flush=${this.flush || nothing}
|
|
219
|
+
isolated
|
|
218
220
|
manual-add-items
|
|
219
221
|
></zn-navbar>
|
|
220
222
|
<div class="input-container">
|
|
@@ -7,9 +7,35 @@
|
|
|
7
7
|
.translations {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
|
-
|
|
10
|
+
padding: 0 var(--zn-spacing-medium);
|
|
11
|
+
gap: var(--zn-spacing-3x-small);
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
.input-container {
|
|
14
15
|
padding: var(--zn-spacing-small) 0;
|
|
15
16
|
}
|
|
17
|
+
|
|
18
|
+
.form-control__label {
|
|
19
|
+
margin-bottom: 0 !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
zn-navbar {
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
margin-top: var(--zn-spacing-x-small);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
zn-navbar::part(navbar) {
|
|
29
|
+
padding: 0;
|
|
30
|
+
gap: 15px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
zn-navbar::part(navbar-item) {
|
|
34
|
+
font-size: var(--zn-font-size-small);
|
|
35
|
+
|
|
36
|
+
--zn-spacing-medium: 7px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
zn-navbar::part(button__base) {
|
|
40
|
+
//padding: 0 5px;
|
|
41
|
+
}
|