@kubex/zinc 1.0.3 → 1.0.5
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/.github/workflows/js_build_and_deploy.yaml +1 -1
- package/dist/custom-elements.json +25150 -0
- package/dist/vscode.html-custom-data.json +2874 -0
- package/dist/web-types.json +6611 -0
- package/dist/zn.d.ts +6664 -0
- package/dist/zn.min.css +1 -0
- package/dist/zn.min.js +4740 -0
- package/docs/_includes/default.njk +1 -0
- package/docs/assets/scripts/docs.js +4 -5
- package/docs/assets/scripts/search.js +0 -9
- package/docs/assets/styles/docs.css +3 -3
- package/docs/data/data-table.json +79 -0
- package/docs/data/products-table.json +36 -0
- package/docs/eleventy.config.cjs +3 -0
- package/docs/pages/components/data-select.md +10 -0
- package/docs/pages/components/data-table.md +84 -45
- package/docs/pages/components/dialog.md +1 -1
- package/docs/pages/components/editor.md +1 -3
- package/docs/pages/components/filter-wrapper.md +20 -0
- package/docs/pages/components/icon.md +2 -0
- package/docs/pages/components/item.md +2 -2
- package/docs/pages/components/menu-item.md +12 -3
- package/docs/pages/components/panel.md +17 -0
- package/docs/pages/components/progress-tile.md +17 -1
- package/docs/pages/components/settings-container.md +137 -0
- package/docs/pages/components/textarea.md +1 -1
- package/package.json +3 -1
- package/scss/_root.scss +26 -0
- package/scss/boot.scss +27 -1
- package/scss/mixins/index.scss +30 -1
- package/scss/shared/_base.scss +1 -1
- package/scss/shared/_button.scss +1 -1
- package/scss/shared/layout.scss +7 -0
- package/scss/themes/_dark.scss +5 -5
- package/scss/themes/_light.scss +6 -5
- package/scss/variables/index.scss +9 -0
- package/src/components/alert/alert.component.ts +1 -1
- package/src/components/alert/alert.scss +18 -4
- package/src/components/button/button.component.ts +6 -2
- package/src/components/button/button.scss +16 -1
- package/src/components/button-menu/button-menu.component.ts +23 -15
- package/src/components/button-menu/button-menu.scss +4 -4
- package/src/components/checkbox/checkbox.component.ts +5 -1
- package/src/components/checkbox/checkbox.scss +1 -1
- package/src/components/chip/chip.component.ts +7 -3
- package/src/components/chip/chip.scss +9 -1
- package/src/components/collapsible/collapsible.component.ts +48 -2
- package/src/components/confirm/confirm.component.ts +1 -2
- package/src/components/content-block/content-block.component.ts +25 -1
- package/src/components/content-block/content-block.scss +8 -0
- package/src/components/data-select/data-select.component.ts +1 -1
- package/src/components/data-table/data-table.component.ts +361 -422
- package/src/components/data-table/data-table.scss +6 -1
- package/src/components/datepicker/datepicker.scss +1 -1
- package/src/components/dialog/dialog.component.ts +52 -33
- package/src/components/dialog/dialog.scss +15 -1
- package/src/components/dropdown/dropdown.component.ts +1 -1
- package/src/components/editor/editor.component.ts +196 -158
- package/src/components/editor/editor.scss +25 -5
- package/src/components/editor/modules/ai/index.ts +281 -0
- package/src/components/editor/modules/ai/panel/ai-panel.component.ts +102 -0
- package/src/components/editor/modules/ai/panel/ai-panel.scss +83 -0
- package/src/components/editor/modules/ai/tooltip/ai-tooltip.component.ts +30 -0
- package/src/components/editor/modules/ai/tooltip/ai-tooltip.scss +28 -0
- package/src/components/editor/modules/{attachment-module.ts → attachment/attachment.ts} +7 -7
- package/src/components/editor/modules/context-menu/context-menu-component.ts +115 -0
- package/src/components/editor/modules/context-menu/context-menu.scss +49 -0
- package/src/components/editor/modules/context-menu/context-menu.ts +296 -0
- package/src/components/editor/modules/context-menu/quick-action/index.ts +12 -0
- package/src/components/editor/modules/context-menu/quick-action/quick-action.component.ts +18 -0
- package/src/components/editor/modules/date-picker/date-picker.ts +77 -0
- package/src/components/editor/modules/dialog/dialog.component.ts +115 -0
- package/src/components/editor/modules/dialog/dialog.scss +43 -0
- package/src/components/editor/modules/dialog/dialog.ts +46 -0
- package/src/components/editor/modules/{drag-drop-module.ts → drag-drop/drag-drop.ts} +6 -6
- package/src/components/editor/modules/emoji/emoji.ts +106 -0
- package/src/components/editor/modules/emoji/headless/headless-emoji.component.ts +122 -0
- package/src/components/editor/modules/emoji/headless/headless-emoji.scss +52 -0
- package/src/components/editor/modules/emoji/headless/headless-emoji.ts +223 -0
- package/src/components/editor/modules/{image-resize-module/image-resize-module.ts → image-resize/image-resize.ts} +5 -5
- package/src/components/editor/modules/{time-tracking-module.ts → time-tracking/time-tracking.ts} +5 -5
- package/src/components/editor/modules/toolbar/tool/index.ts +12 -0
- package/src/components/editor/modules/toolbar/tool/tool.component.ts +30 -0
- package/src/components/editor/modules/toolbar/tool/tool.scss +5 -0
- package/src/components/editor/modules/toolbar/toolbar.component.ts +738 -0
- package/src/components/editor/modules/toolbar/toolbar.scss +98 -0
- package/src/components/editor/modules/toolbar/toolbar.ts +328 -0
- package/src/components/expanding-action/expanding-action.component.ts +2 -2
- package/src/components/expanding-action/expanding-action.scss +2 -2
- package/src/components/filter-wrapper/filter-wrapper.component.ts +91 -0
- package/src/components/filter-wrapper/filter-wrapper.scss +11 -0
- package/src/components/filter-wrapper/filter-wrapper.test.ts +10 -0
- package/src/components/filter-wrapper/index.ts +12 -0
- package/src/components/header/header.component.ts +1 -1
- package/src/components/header/header.scss +8 -1
- package/src/components/hover-container/hover-container.scss +39 -36
- package/src/components/icon/icon.component.ts +11 -5
- package/src/components/icon/icon.scss +15 -2
- package/src/components/inline-edit/inline-edit.component.ts +28 -3
- package/src/components/inline-edit/inline-edit.scss +4 -1
- package/src/components/input/input.scss +1 -1
- package/src/components/item/item.component.ts +30 -19
- package/src/components/item/item.scss +56 -14
- package/src/components/linked-select/linked-select.component.ts +5 -1
- package/src/components/menu/menu.component.ts +1 -0
- package/src/components/menu/menu.scss +1 -1
- package/src/components/menu-item/menu-item.component.ts +22 -4
- package/src/components/menu-item/menu-item.scss +54 -7
- package/src/components/navbar/navbar.component.ts +7 -1
- package/src/components/navbar/navbar.scss +26 -16
- package/src/components/option/option.component.ts +4 -1
- package/src/components/option/option.scss +9 -0
- package/src/components/page-nav/page-nav.component.ts +2 -2
- package/src/components/page-nav/page-nav.scss +4 -4
- package/src/components/panel/panel.component.ts +20 -9
- package/src/components/panel/panel.scss +5 -1
- package/src/components/popup/popup.component.ts +16 -2
- package/src/components/progress-tile/progress-tile.component.ts +10 -4
- package/src/components/progress-tile/progress-tile.scss +7 -4
- package/src/components/query-builder/query-builder.component.ts +1 -1
- package/src/components/radio/radio.scss +1 -1
- package/src/components/scroll-container/scroll-container.component.ts +56 -9
- package/src/components/scroll-container/scroll-container.scss +37 -2
- package/src/components/select/select.component.ts +3 -0
- package/src/components/select/select.scss +1 -1
- package/src/components/settings-container/index.ts +12 -0
- package/src/components/settings-container/settings-container.component.ts +226 -0
- package/src/components/settings-container/settings-container.scss +92 -0
- package/src/components/settings-container/settings-container.test.ts +10 -0
- package/src/components/skeleton/skeleton.scss +5 -4
- package/src/components/sp/sp.component.ts +2 -0
- package/src/components/sp/sp.scss +2 -0
- package/src/components/split-button/split-button.component.ts +24 -18
- package/src/components/split-pane/split-pane.component.ts +5 -5
- package/src/components/stat/stat.component.ts +5 -1
- package/src/components/stat/stat.scss +24 -1
- package/src/components/style/style.component.ts +18 -0
- package/src/components/tabs/tabs.component.ts +12 -1
- package/src/components/textarea/textarea.component.ts +3 -1
- package/src/components/textarea/textarea.scss +21 -2
- package/src/components/vertical-stepper/vertical-stepper.scss +1 -1
- package/src/internal/form.ts +3 -1
- package/src/internal/slot.ts +29 -3
- package/src/utilities/on.ts +7 -8
- package/src/utilities/query.ts +5 -1
- package/src/wc.scss +7 -0
- package/src/zinc.ts +5 -0
- package/src/components/editor/modules/dialog-module/dialog-module.component.ts +0 -289
- package/src/components/editor/modules/dialog-module/dialog-module.scss +0 -115
- package/src/components/editor/modules/dialog-module/dialog-module.ts +0 -99
- package/src/components/editor/modules/events/zn-show-canned-response-dialog.ts +0 -15
- package/src/components/editor/modules/menu-module/menu-module.component.ts +0 -149
- package/src/components/editor/modules/menu-module/menu-module.scss +0 -17
- package/src/components/editor/modules/menu-module/menu-module.ts +0 -203
|
@@ -13,47 +13,50 @@
|
|
|
13
13
|
display: contents;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.hover-container
|
|
17
|
-
|
|
18
|
-
}
|
|
16
|
+
.hover-container {
|
|
17
|
+
position: relative;
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
19
|
+
&--top::part(popup) {
|
|
20
|
+
transform-origin: bottom;
|
|
21
|
+
}
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
23
|
+
&--bottom::part(popup) {
|
|
24
|
+
transform-origin: top;
|
|
25
|
+
}
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
27
|
+
&--left::part(popup) {
|
|
28
|
+
transform-origin: right;
|
|
29
|
+
}
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
31
|
+
&--right::part(popup) {
|
|
32
|
+
transform-origin: left;
|
|
33
|
+
}
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
35
|
+
&__body {
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
z-index: 2;
|
|
38
|
+
background-color: var(--zn-panel-background-color);
|
|
39
|
+
border-radius: var(--zn-border-radius-large);
|
|
40
|
+
border: 1px solid rgb(var(--zn-border-color));
|
|
41
|
+
box-shadow: var(--zn-shadow-x-large);
|
|
42
|
+
width: var(--width);
|
|
43
|
+
max-width: calc(100% - var(--zn-spacing-2x-large));
|
|
44
|
+
max-height: calc(100% - var(--zn-spacing-2x-large));
|
|
45
|
+
|
|
46
|
+
::slotted(*) {
|
|
47
|
+
flex: 1 1 auto;
|
|
48
|
+
display: block;
|
|
49
|
+
overflow: auto;
|
|
50
|
+
-webkit-overflow-scrolling: touch;
|
|
51
|
+
color: var(--zn-color-text-default);
|
|
52
|
+
font-size: var(--zn-font-size-medium);
|
|
53
|
+
font-weight: var(--zn-font-weight-normal);
|
|
54
|
+
letter-spacing: var(--zn-tracking-normal);
|
|
55
|
+
line-height: var(--zn-line-height-dense);
|
|
56
|
+
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
slot[slot='anchor'] {
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
}
|
|
@@ -8,7 +8,7 @@ import ZincElement from '../../internal/zinc-element';
|
|
|
8
8
|
|
|
9
9
|
import styles from './icon.scss';
|
|
10
10
|
|
|
11
|
-
type IconLibrary = "material" | "material-outlined" | "material-round" | "material-sharp" |
|
|
11
|
+
type IconLibrary = "src" | "material" | "material-outlined" | "material-round" | "material-sharp" |
|
|
12
12
|
"material-two-tone" | "material-symbols-outlined" | "gravatar" | "libravatar" | "avatar" | "brands" | "line";
|
|
13
13
|
|
|
14
14
|
export type IconColor =
|
|
@@ -63,6 +63,10 @@ export default class ZnIcon extends ZincElement {
|
|
|
63
63
|
|
|
64
64
|
@property({reflect: true}) color: IconColor;
|
|
65
65
|
|
|
66
|
+
@property({type: Boolean}) padded: boolean = false;
|
|
67
|
+
|
|
68
|
+
@property({type: Boolean}) squared: boolean = false;
|
|
69
|
+
|
|
66
70
|
gravatarOptions = "";
|
|
67
71
|
defaultLibrary: IconLibrary = "material-symbols-outlined";
|
|
68
72
|
|
|
@@ -142,7 +146,7 @@ export default class ZnIcon extends ZincElement {
|
|
|
142
146
|
// load the material icons font if the library is set to material
|
|
143
147
|
render(html`
|
|
144
148
|
<link
|
|
145
|
-
href="https://cdn.jsdelivr.net/gh/kubex/icons@0.0.
|
|
149
|
+
href="https://cdn.jsdelivr.net/gh/kubex/icons@0.0.8/dist/kubex-icons.css"
|
|
146
150
|
rel="stylesheet">
|
|
147
151
|
<link
|
|
148
152
|
href="https://cdn.lineicons.com/5.0/lineicons.css"
|
|
@@ -186,12 +190,14 @@ export default class ZnIcon extends ZincElement {
|
|
|
186
190
|
'icon--violet': this.color === "violet",
|
|
187
191
|
'icon--pink': this.color === "pink",
|
|
188
192
|
'icon--grey': this.color === "grey",
|
|
189
|
-
'icon--avatar': this.library === "avatar"
|
|
193
|
+
'icon--avatar': this.library === "avatar",
|
|
194
|
+
'icon--padded': this.padded,
|
|
195
|
+
'icon--squared': this.squared,
|
|
190
196
|
})}" style="${styleMap({
|
|
191
197
|
'--icon-size': this.size + "px",
|
|
192
198
|
'--avatar-color': this.color ? null : (this.library === 'avatar' ? this.getColorForAvatar(this.getAvatarInitials(this.src)) : null)
|
|
193
199
|
})}">
|
|
194
|
-
${this.library ? html`
|
|
200
|
+
${this.library && this.library !== "src" ? html`
|
|
195
201
|
${choose(this.library, [
|
|
196
202
|
["material", () => html`<i part="icon" class="mi">${this.src}</i>`],
|
|
197
203
|
["material-outlined", () => html`<i part="icon" class="mi mi--outlined">${this.src}</i>`],
|
|
@@ -208,7 +214,7 @@ export default class ZnIcon extends ZincElement {
|
|
|
208
214
|
["avatar", () => html`<span class="avatar__text">${this.getAvatarInitials(this.src)}</span>`]
|
|
209
215
|
], () => html`Library not supported: ${this.library}`)}` : ''}
|
|
210
216
|
|
|
211
|
-
${!this.library && this.src ? html`
|
|
217
|
+
${(!this.library || this.library === 'src') && this.src ? html`
|
|
212
218
|
<img part="icon" src="${this.src}" alt="${this.alt}" class="${this.library}" height="${this.size}"
|
|
213
219
|
width="${this.size}"/>` : ''}
|
|
214
220
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@use "../../wc";
|
|
2
2
|
@use "./lni";
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
:host {
|
|
6
5
|
display: inline-block;
|
|
7
6
|
box-sizing: content-box !important;
|
|
@@ -10,6 +9,10 @@
|
|
|
10
9
|
--icon-color: inherit;
|
|
11
10
|
}
|
|
12
11
|
|
|
12
|
+
:host([split-pane-focus]) .icon-wrapper {
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
|
|
13
16
|
.icon-wrapper {
|
|
14
17
|
user-select: none;
|
|
15
18
|
font-family: sans-serif;
|
|
@@ -27,7 +30,6 @@
|
|
|
27
30
|
height: 100%;
|
|
28
31
|
}
|
|
29
32
|
|
|
30
|
-
|
|
31
33
|
.icon {
|
|
32
34
|
width: var(--icon-size);
|
|
33
35
|
height: var(--icon-size);
|
|
@@ -131,6 +133,17 @@
|
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
135
|
|
|
136
|
+
&--padded {
|
|
137
|
+
padding: var(--zn-spacing-small);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&--squared {
|
|
141
|
+
width: auto !important;
|
|
142
|
+
height: auto !important;
|
|
143
|
+
aspect-ratio: 1/1;
|
|
144
|
+
display: block;
|
|
145
|
+
}
|
|
146
|
+
|
|
134
147
|
.mi {
|
|
135
148
|
font-family: 'Material Icons';
|
|
136
149
|
font-size: inherit;
|
|
@@ -5,9 +5,9 @@ import {FormControlController} from "../../internal/form";
|
|
|
5
5
|
import {ifDefined} from "lit/directives/if-defined.js";
|
|
6
6
|
import {property, query, state} from 'lit/decorators.js';
|
|
7
7
|
import {watch} from "../../internal/watch";
|
|
8
|
-
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
9
8
|
import ZincElement from '../../internal/zinc-element';
|
|
10
9
|
import ZnSelect from "../select";
|
|
10
|
+
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
11
11
|
import type ZnInput from "../input";
|
|
12
12
|
|
|
13
13
|
import styles from './inline-edit.scss';
|
|
@@ -103,11 +103,15 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
|
|
|
103
103
|
connectedCallback() {
|
|
104
104
|
super.connectedCallback();
|
|
105
105
|
document.addEventListener('keydown', this.escKeyHandler);
|
|
106
|
+
document.addEventListener('keydown', this.submitKeyHandler);
|
|
107
|
+
document.addEventListener('click', this.mouseEventHandler);
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
disconnectedCallback() {
|
|
109
111
|
super.disconnectedCallback();
|
|
110
112
|
document.removeEventListener('keydown', this.escKeyHandler);
|
|
113
|
+
document.removeEventListener('keydown', this.submitKeyHandler);
|
|
114
|
+
document.removeEventListener('click', this.mouseEventHandler);
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
async firstUpdated() {
|
|
@@ -129,14 +133,33 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
|
|
|
129
133
|
}
|
|
130
134
|
}
|
|
131
135
|
|
|
136
|
+
mouseEventHandler = (e: MouseEvent) => {
|
|
137
|
+
if (this.isEditing && !this.contains(e.target as Node)) {
|
|
138
|
+
this.isEditing = false;
|
|
139
|
+
this.value = this.defaultValue;
|
|
140
|
+
this.input.blur();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
132
144
|
escKeyHandler = (e: KeyboardEvent) => {
|
|
133
145
|
if (e.key === 'Escape' && this.isEditing) {
|
|
134
146
|
this.isEditing = false;
|
|
135
147
|
this.value = this.defaultValue;
|
|
148
|
+
this.input.blur();
|
|
136
149
|
}
|
|
137
150
|
};
|
|
138
151
|
|
|
139
|
-
|
|
152
|
+
submitKeyHandler = (e: KeyboardEvent) => {
|
|
153
|
+
if (e.key === 'Enter' && this.isEditing) {
|
|
154
|
+
this.isEditing = false;
|
|
155
|
+
this.formControlController.submit();
|
|
156
|
+
this.input.blur();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
handleEditClick = (e: MouseEvent) => {
|
|
161
|
+
e.preventDefault();
|
|
162
|
+
e.stopPropagation();
|
|
140
163
|
if (this.disabled) {
|
|
141
164
|
return;
|
|
142
165
|
}
|
|
@@ -235,6 +258,7 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
|
|
|
235
258
|
name="${this.name}"
|
|
236
259
|
size="${this.size}"
|
|
237
260
|
value="${this.value}"
|
|
261
|
+
placeholder="${this.placeholder}"
|
|
238
262
|
help-text="${ifDefined(this.helpText)}"
|
|
239
263
|
pattern=${ifDefined(this.pattern)}
|
|
240
264
|
@zn-input="${this.handleInput}"
|
|
@@ -249,6 +273,7 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
|
|
|
249
273
|
name="${this.name}"
|
|
250
274
|
size="${this.size}"
|
|
251
275
|
value="${this.value}"
|
|
276
|
+
placeholder="${this.placeholder}"
|
|
252
277
|
help-text="${ifDefined(this.helpText)}"
|
|
253
278
|
pattern=${ifDefined(this.pattern)}
|
|
254
279
|
@zn-input="${this.handleInput}"
|
|
@@ -263,7 +288,7 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
|
|
|
263
288
|
value="${this.value}"
|
|
264
289
|
help-text="${ifDefined(this.helpText)}"
|
|
265
290
|
size="${this.size}"
|
|
266
|
-
placeholder="
|
|
291
|
+
placeholder="${this.placeholder}"
|
|
267
292
|
@zn-input="${this.handleInput}"
|
|
268
293
|
@zn-blur="${this.handleBlur}">
|
|
269
294
|
${Object.keys(this.options).map(key => html`
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
line-height: var(--zn-line-height-looser);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
.ai__input::part(display-input) {
|
|
30
|
+
color: rgb(var(--zn-text));
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
.ai__input::part(input), .ai__input::part(combobox) {
|
|
30
34
|
padding: 0;
|
|
31
35
|
color: rgb(var(--zn-text));
|
|
@@ -91,7 +95,6 @@
|
|
|
91
95
|
&--editing {
|
|
92
96
|
.ai__right {
|
|
93
97
|
display: flex !important;
|
|
94
|
-
align-items: start;
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
justify-content: start;
|
|
13
13
|
position: relative;
|
|
14
14
|
width: 100%;
|
|
15
|
-
box-shadow: var(--zn-shadow-
|
|
15
|
+
box-shadow: var(--zn-shadow-x-small);
|
|
16
16
|
font-family: var(--zn-input-font-family), sans-serif;
|
|
17
17
|
font-weight: var(--zn-input-font-weight);
|
|
18
18
|
letter-spacing: var(--zn-input-letter-spacing);
|
|
@@ -30,6 +30,8 @@ export default class ZnItem extends ZincElement {
|
|
|
30
30
|
|
|
31
31
|
@property() caption: string;
|
|
32
32
|
|
|
33
|
+
@property() description: string;
|
|
34
|
+
|
|
33
35
|
@property({type: Boolean}) stacked: boolean;
|
|
34
36
|
|
|
35
37
|
@property({reflect: true}) size: 'small' | 'medium' | 'large' = 'medium';
|
|
@@ -46,6 +48,9 @@ export default class ZnItem extends ZincElement {
|
|
|
46
48
|
|
|
47
49
|
@property({type: Boolean, attribute: 'no-padding'}) noPadding: boolean;
|
|
48
50
|
|
|
51
|
+
// align items to the right
|
|
52
|
+
@property({type: Boolean, attribute: 'align-end'}) alignEnd: boolean;
|
|
53
|
+
|
|
49
54
|
connectedCallback() {
|
|
50
55
|
super.connectedCallback();
|
|
51
56
|
this.setAttribute('role', 'listitem');
|
|
@@ -63,37 +68,43 @@ export default class ZnItem extends ZincElement {
|
|
|
63
68
|
render() {
|
|
64
69
|
const hasIcon = this.icon && this.icon.length > 0;
|
|
65
70
|
|
|
71
|
+
const headings = html`
|
|
72
|
+
<div class="item__headings">
|
|
73
|
+
<div class="item__caption" part="caption">${this.caption}</div>
|
|
74
|
+
${this.description ? html`<div class="item__description">${this.description}</div>` : ''}
|
|
75
|
+
</div>`;
|
|
76
|
+
|
|
66
77
|
return html`
|
|
67
78
|
<div
|
|
68
79
|
class=${classMap({
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
'
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
'
|
|
77
|
-
'
|
|
78
|
-
'
|
|
80
|
+
'item': true,
|
|
81
|
+
'item--stacked': this.stacked,
|
|
82
|
+
'item--edit-on-hover': this.editOnHover,
|
|
83
|
+
'item--inline': this.inline,
|
|
84
|
+
'item--grid': this.grid,
|
|
85
|
+
'item--small': this.size === 'small',
|
|
86
|
+
'item--medium': this.size === 'medium',
|
|
87
|
+
'item--large': this.size === 'large',
|
|
88
|
+
'item--has-icon': hasIcon,
|
|
89
|
+
'item--no-padding': this.noPadding,
|
|
90
|
+
'item--align-end': this.alignEnd
|
|
79
91
|
})}
|
|
80
92
|
part="base">
|
|
81
93
|
|
|
82
94
|
${this.icon ? html`
|
|
83
|
-
<div class="
|
|
84
|
-
<div class="
|
|
95
|
+
<div class="item__header">
|
|
96
|
+
<div class="item__icon">
|
|
85
97
|
<zn-icon src="${this.icon}" size="20" part="icon"></zn-icon>
|
|
86
98
|
</div>
|
|
87
|
-
|
|
88
|
-
</div>` :
|
|
89
|
-
<div class="description-item__caption" part="caption">${this.caption}</div>`}
|
|
99
|
+
${headings}
|
|
100
|
+
</div>` : headings}
|
|
90
101
|
|
|
91
|
-
<div class="
|
|
92
|
-
<div class="
|
|
102
|
+
<div class="item__content">
|
|
103
|
+
<div class="item__content-inner">
|
|
93
104
|
<slot>${this.value}</slot>
|
|
94
105
|
</div>
|
|
95
|
-
<div class="
|
|
96
|
-
<slot name="actions" class="
|
|
106
|
+
<div class="item__action-wrapper">
|
|
107
|
+
<slot name="actions" class="item__actions"></slot>
|
|
97
108
|
</div>
|
|
98
109
|
</div>
|
|
99
110
|
</div>
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
--zn-item-label-max-width: 300px;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.
|
|
10
|
+
.item {
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: row;
|
|
13
13
|
padding: 0 var(--zn-spacing-medium);
|
|
14
|
+
gap: var(--zn-spacing-2x-small);
|
|
14
15
|
|
|
15
16
|
@include wc.container-query(null, md) {
|
|
16
17
|
--zn-item-label-max-width: 200px;
|
|
@@ -26,9 +27,7 @@
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
&--has-icon {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.description-item__icon {
|
|
30
|
+
.item__icon {
|
|
32
31
|
position: relative;
|
|
33
32
|
line-height: 33px;
|
|
34
33
|
display: flex;
|
|
@@ -38,32 +37,54 @@
|
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
|
|
40
|
+
&--align-end .description-item__content {
|
|
41
|
+
text-align: right;
|
|
42
|
+
}
|
|
43
|
+
|
|
41
44
|
&__header {
|
|
42
45
|
display: flex;
|
|
46
|
+
align-items: center;
|
|
43
47
|
max-width: var(--zn-item-label-max-width);
|
|
44
48
|
width: 100%;
|
|
45
49
|
|
|
46
|
-
.
|
|
50
|
+
.item__caption {
|
|
47
51
|
width: unset;
|
|
48
52
|
max-width: unset;
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
|
|
56
|
+
&__headings {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
max-width: var(--zn-item-label-max-width);
|
|
60
|
+
width: 100%;
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
52
64
|
&__content {
|
|
53
65
|
width: 100%;
|
|
54
66
|
display: flex;
|
|
55
67
|
justify-content: space-between;
|
|
56
|
-
line-height:
|
|
68
|
+
line-height: 33px;
|
|
57
69
|
}
|
|
58
70
|
|
|
59
71
|
&__content-inner {
|
|
60
72
|
width: 100%;
|
|
73
|
+
|
|
74
|
+
::slotted(a) {
|
|
75
|
+
color: rgb(var(--zn-primary)) !important;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
::slotted(zn-icon) {
|
|
79
|
+
vertical-align: middle;
|
|
80
|
+
margin-right: var(--zn-spacing-2x-small);
|
|
81
|
+
}
|
|
61
82
|
}
|
|
62
83
|
|
|
63
84
|
&__caption {
|
|
64
85
|
font-weight: 500;
|
|
65
86
|
color: rgb(var(--zn-text-heading));
|
|
66
|
-
line-height:
|
|
87
|
+
line-height: var(--zn-line-height-normal);
|
|
67
88
|
max-width: var(--zn-item-label-max-width);
|
|
68
89
|
width: 100%;
|
|
69
90
|
flex-shrink: 0;
|
|
@@ -73,8 +94,20 @@
|
|
|
73
94
|
}
|
|
74
95
|
}
|
|
75
96
|
|
|
97
|
+
&__description {
|
|
98
|
+
display: block;
|
|
99
|
+
font-weight: 400;
|
|
100
|
+
margin: var(--zn-spacing-2x-small) 0 0;
|
|
101
|
+
font-size: var(--zn-font-size-small);
|
|
102
|
+
color: rgb(var(--zn-text-color));
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
text-overflow: ellipsis;
|
|
106
|
+
}
|
|
107
|
+
|
|
76
108
|
&__action-wrapper {
|
|
77
109
|
display: inline-block;
|
|
110
|
+
align-content: center;
|
|
78
111
|
}
|
|
79
112
|
|
|
80
113
|
&__actions {
|
|
@@ -86,11 +119,11 @@
|
|
|
86
119
|
|
|
87
120
|
// Sizes
|
|
88
121
|
&--small {
|
|
89
|
-
&.
|
|
122
|
+
&.item {
|
|
90
123
|
padding: var(--zn-spacing-x-small);
|
|
91
124
|
}
|
|
92
125
|
|
|
93
|
-
.
|
|
126
|
+
.item__caption, .item__content-inner {
|
|
94
127
|
font-size: var(--zn-font-size-small);
|
|
95
128
|
}
|
|
96
129
|
|
|
@@ -110,7 +143,7 @@
|
|
|
110
143
|
display: none;
|
|
111
144
|
}
|
|
112
145
|
|
|
113
|
-
.
|
|
146
|
+
.item__actions {
|
|
114
147
|
display: none;
|
|
115
148
|
}
|
|
116
149
|
|
|
@@ -119,7 +152,7 @@
|
|
|
119
152
|
display: flex;
|
|
120
153
|
}
|
|
121
154
|
|
|
122
|
-
.
|
|
155
|
+
.item__actions {
|
|
123
156
|
display: flex;
|
|
124
157
|
}
|
|
125
158
|
}
|
|
@@ -129,20 +162,29 @@
|
|
|
129
162
|
|
|
130
163
|
gap: var(--zn-spacing-small);
|
|
131
164
|
|
|
132
|
-
.
|
|
165
|
+
.item__header {
|
|
133
166
|
width: unset;
|
|
134
167
|
max-width: unset;
|
|
135
168
|
}
|
|
136
169
|
|
|
137
|
-
.
|
|
170
|
+
.item__icon {
|
|
138
171
|
margin-right: 0;
|
|
139
172
|
}
|
|
140
173
|
|
|
141
|
-
.
|
|
174
|
+
.item__caption {
|
|
142
175
|
width: unset;
|
|
143
176
|
max-width: unset;
|
|
144
177
|
}
|
|
145
178
|
|
|
179
|
+
.item__headings {
|
|
180
|
+
width: unset;
|
|
181
|
+
max-width: unset;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.item__description {
|
|
185
|
+
margin: 0;
|
|
186
|
+
}
|
|
187
|
+
|
|
146
188
|
@include wc.container-query(null, sm) {
|
|
147
189
|
flex-direction: row;
|
|
148
190
|
align-items: center;
|
|
@@ -46,7 +46,7 @@ export default class ZnLinkedSelect extends ZincElement implements ZincFormContr
|
|
|
46
46
|
@property({attribute: 'cache-key'}) cacheKey: string = "";
|
|
47
47
|
@property() label: string = "";
|
|
48
48
|
|
|
49
|
-
@query('zn-select') input:
|
|
49
|
+
@query('zn-select') input: ZnSelect;
|
|
50
50
|
|
|
51
51
|
private linkedSelectElement: HTMLSelectElement | ZnSelect;
|
|
52
52
|
private readonly formControlController = new FormControlController(this, {
|
|
@@ -60,6 +60,10 @@ export default class ZnLinkedSelect extends ZincElement implements ZincFormContr
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
+
get displayLabel() {
|
|
64
|
+
return (this.input as ZnSelect).displayLabel;
|
|
65
|
+
}
|
|
66
|
+
|
|
63
67
|
get validity() {
|
|
64
68
|
return this.input?.validity;
|
|
65
69
|
}
|
|
@@ -169,6 +169,7 @@ export default class ZnMenu extends ZincElement {
|
|
|
169
169
|
// get the parent dropdown and close it
|
|
170
170
|
(closestMenu?.closest('zn-dropdown') as ZnDropdown | null)?.hide();
|
|
171
171
|
|
|
172
|
+
console.log('emitting select')
|
|
172
173
|
this.emit('zn-select', {detail: {item}});
|
|
173
174
|
}
|
|
174
175
|
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
min-width: var(--zn-spacing-small-panel);
|
|
10
10
|
overflow: auto;
|
|
11
11
|
overscroll-behavior: none;
|
|
12
|
-
|
|
12
|
+
box-shadow: var(--zn-shadow-medium);
|
|
13
13
|
background-color: rgb(var(--zn-panel, 255, 255, 255));
|
|
14
14
|
}
|
|
@@ -50,6 +50,8 @@ export default class ZnMenuItem extends ZincElement {
|
|
|
50
50
|
/** Draws the item in a checked state. */
|
|
51
51
|
@property({type: Boolean, reflect: true}) checked = false;
|
|
52
52
|
|
|
53
|
+
@property({attribute: 'checked-position', reflect: true}) checkedPosition: 'left' | 'right' = 'left';
|
|
54
|
+
|
|
53
55
|
/** A unique value to store in the menu item. This can be used as a way to identify menu items when selected. */
|
|
54
56
|
@property() value = '';
|
|
55
57
|
|
|
@@ -59,6 +61,8 @@ export default class ZnMenuItem extends ZincElement {
|
|
|
59
61
|
/** Draws the menu item in a disabled state, preventing selection. */
|
|
60
62
|
@property({type: Boolean, reflect: true}) disabled = false;
|
|
61
63
|
|
|
64
|
+
@property() color: string;
|
|
65
|
+
|
|
62
66
|
// Link Specific
|
|
63
67
|
@property() href: string;
|
|
64
68
|
|
|
@@ -193,13 +197,22 @@ export default class ZnMenuItem extends ZincElement {
|
|
|
193
197
|
'menu-item--disabled': this.disabled,
|
|
194
198
|
'menu-item--loading': this.loading,
|
|
195
199
|
'menu-item--has-submenu': this.isSubmenu(),
|
|
196
|
-
'menu-item--submenu-expanded': isSubmenuExpanded
|
|
200
|
+
'menu-item--submenu-expanded': isSubmenuExpanded,
|
|
201
|
+
'menu-item--primary': this.color === 'primary',
|
|
202
|
+
'menu-item--secondary': this.color === 'secondary',
|
|
203
|
+
'menu-item--error': this.color === 'error',
|
|
204
|
+
'menu-item--info': this.color === 'info',
|
|
205
|
+
'menu-item--success': this.color === 'success',
|
|
206
|
+
'menu-item--warning': this.color === 'warning',
|
|
207
|
+
'menu-item--transparent': this.color === 'transparent',
|
|
208
|
+
|
|
197
209
|
})}
|
|
198
210
|
?aria-haspopup="${this.isSubmenu()}"
|
|
199
211
|
?aria-expanded="${isSubmenuExpanded}">
|
|
200
|
-
|
|
201
|
-
<
|
|
202
|
-
|
|
212
|
+
${this.checkedPosition === 'left' ? html`
|
|
213
|
+
<span part="checked-icon" class="menu-item__check">
|
|
214
|
+
<zn-icon src="check_small" aria-hidden="true"></zn-icon>
|
|
215
|
+
</span>` : ''}
|
|
203
216
|
|
|
204
217
|
<slot name="prefix" part="prefix" class="menu-item__prefix"></slot>
|
|
205
218
|
|
|
@@ -207,6 +220,11 @@ export default class ZnMenuItem extends ZincElement {
|
|
|
207
220
|
|
|
208
221
|
<slot name="suffix" part="suffix" class="menu-item__suffix"></slot>
|
|
209
222
|
|
|
223
|
+
${this.checkedPosition === 'right' ? html`
|
|
224
|
+
<span part="checked-icon" class="menu-item__check">
|
|
225
|
+
<zn-icon src="check_small" aria-hidden="true"></zn-icon>
|
|
226
|
+
</span>` : ''}
|
|
227
|
+
|
|
210
228
|
<span part="submenu-icon" class="menu-item__chevron">
|
|
211
229
|
<zn-icon src=${isRtl ? 'chevron_left' : 'chevron_right'} aria-hidden="true"></zn-icon>
|
|
212
230
|
</span>
|