@kubex/zinc 1.0.4 → 1.0.6

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.
Files changed (158) hide show
  1. package/dist/custom-elements.json +1278 -191
  2. package/dist/vscode.html-custom-data.json +93 -16
  3. package/dist/web-types.json +235 -25
  4. package/dist/zn.d.ts +1313 -941
  5. package/dist/zn.min.css +1 -1
  6. package/dist/zn.min.js +2049 -931
  7. package/docs/_includes/default.njk +1 -0
  8. package/docs/assets/scripts/docs.js +4 -5
  9. package/docs/assets/scripts/search.js +0 -9
  10. package/docs/assets/styles/docs.css +3 -3
  11. package/docs/data/data-table.json +79 -0
  12. package/docs/data/products-table.json +36 -0
  13. package/docs/eleventy.config.cjs +3 -0
  14. package/docs/pages/components/data-select.md +10 -0
  15. package/docs/pages/components/data-table.md +84 -45
  16. package/docs/pages/components/dialog.md +1 -1
  17. package/docs/pages/components/editor.md +1 -3
  18. package/docs/pages/components/filter-wrapper.md +20 -0
  19. package/docs/pages/components/icon.md +2 -0
  20. package/docs/pages/components/item.md +2 -2
  21. package/docs/pages/components/menu-item.md +12 -3
  22. package/docs/pages/components/panel.md +17 -0
  23. package/docs/pages/components/progress-tile.md +17 -1
  24. package/docs/pages/components/settings-container.md +137 -0
  25. package/docs/pages/components/textarea.md +1 -1
  26. package/package.json +3 -1
  27. package/scss/_root.scss +26 -0
  28. package/scss/boot.scss +27 -1
  29. package/scss/mixins/index.scss +30 -1
  30. package/scss/shared/_base.scss +1 -1
  31. package/scss/shared/_button.scss +1 -1
  32. package/scss/shared/layout.scss +7 -0
  33. package/scss/themes/_dark.scss +5 -5
  34. package/scss/themes/_light.scss +6 -5
  35. package/scss/variables/index.scss +9 -0
  36. package/src/components/alert/alert.component.ts +1 -1
  37. package/src/components/alert/alert.scss +18 -4
  38. package/src/components/bulk-actions/bulk-actions.component.ts +152 -84
  39. package/src/components/bulk-actions/bulk-actions.scss +2 -0
  40. package/src/components/button/button.component.ts +6 -2
  41. package/src/components/button/button.scss +16 -1
  42. package/src/components/button-menu/button-menu.component.ts +23 -15
  43. package/src/components/button-menu/button-menu.scss +4 -4
  44. package/src/components/chart/chart.component.ts +14 -12
  45. package/src/components/checkbox/checkbox.component.ts +5 -1
  46. package/src/components/checkbox/checkbox.scss +1 -1
  47. package/src/components/chip/chip.component.ts +7 -3
  48. package/src/components/chip/chip.scss +9 -1
  49. package/src/components/collapsible/collapsible.component.ts +48 -2
  50. package/src/components/cols/cols.component.ts +7 -3
  51. package/src/components/cols/cols.scss +22 -14
  52. package/src/components/confirm/confirm.component.ts +1 -2
  53. package/src/components/content-block/content-block.component.ts +104 -14
  54. package/src/components/content-block/content-block.scss +8 -0
  55. package/src/components/data-select/data-select.component.ts +1 -1
  56. package/src/components/data-table/data-table.component.ts +394 -430
  57. package/src/components/data-table/data-table.scss +6 -1
  58. package/src/components/datepicker/datepicker.scss +1 -1
  59. package/src/components/dialog/dialog.component.ts +52 -33
  60. package/src/components/dialog/dialog.scss +15 -1
  61. package/src/components/dropdown/dropdown.component.ts +1 -1
  62. package/src/components/editor/editor.component.ts +196 -158
  63. package/src/components/editor/editor.scss +25 -5
  64. package/src/components/editor/modules/ai/index.ts +281 -0
  65. package/src/components/editor/modules/ai/panel/ai-panel.component.ts +102 -0
  66. package/src/components/editor/modules/ai/panel/ai-panel.scss +83 -0
  67. package/src/components/editor/modules/ai/tooltip/ai-tooltip.component.ts +30 -0
  68. package/src/components/editor/modules/ai/tooltip/ai-tooltip.scss +28 -0
  69. package/src/components/editor/modules/{attachment-module.ts → attachment/attachment.ts} +7 -7
  70. package/src/components/editor/modules/context-menu/context-menu-component.ts +115 -0
  71. package/src/components/editor/modules/context-menu/context-menu.scss +49 -0
  72. package/src/components/editor/modules/context-menu/context-menu.ts +296 -0
  73. package/src/components/editor/modules/context-menu/quick-action/index.ts +12 -0
  74. package/src/components/editor/modules/context-menu/quick-action/quick-action.component.ts +18 -0
  75. package/src/components/editor/modules/date-picker/date-picker.ts +77 -0
  76. package/src/components/editor/modules/dialog/dialog.component.ts +115 -0
  77. package/src/components/editor/modules/dialog/dialog.scss +43 -0
  78. package/src/components/editor/modules/dialog/dialog.ts +46 -0
  79. package/src/components/editor/modules/{drag-drop-module.ts → drag-drop/drag-drop.ts} +6 -6
  80. package/src/components/editor/modules/emoji/emoji.ts +106 -0
  81. package/src/components/editor/modules/emoji/headless/headless-emoji.component.ts +122 -0
  82. package/src/components/editor/modules/emoji/headless/headless-emoji.scss +52 -0
  83. package/src/components/editor/modules/emoji/headless/headless-emoji.ts +223 -0
  84. package/src/components/editor/modules/{image-resize-module/image-resize-module.ts → image-resize/image-resize.ts} +5 -5
  85. package/src/components/editor/modules/{time-tracking-module.ts → time-tracking/time-tracking.ts} +5 -5
  86. package/src/components/editor/modules/toolbar/tool/index.ts +12 -0
  87. package/src/components/editor/modules/toolbar/tool/tool.component.ts +30 -0
  88. package/src/components/editor/modules/toolbar/tool/tool.scss +5 -0
  89. package/src/components/editor/modules/toolbar/toolbar.component.ts +738 -0
  90. package/src/components/editor/modules/toolbar/toolbar.scss +98 -0
  91. package/src/components/editor/modules/toolbar/toolbar.ts +328 -0
  92. package/src/components/expanding-action/expanding-action.component.ts +2 -2
  93. package/src/components/expanding-action/expanding-action.scss +2 -2
  94. package/src/components/filter-wrapper/filter-wrapper.component.ts +91 -0
  95. package/src/components/filter-wrapper/filter-wrapper.scss +11 -0
  96. package/src/components/filter-wrapper/filter-wrapper.test.ts +10 -0
  97. package/src/components/filter-wrapper/index.ts +12 -0
  98. package/src/components/header/header.component.ts +1 -1
  99. package/src/components/header/header.scss +8 -1
  100. package/src/components/hover-container/hover-container.scss +39 -36
  101. package/src/components/icon/icon.component.ts +11 -5
  102. package/src/components/icon/icon.scss +15 -2
  103. package/src/components/inline-edit/inline-edit.component.ts +52 -6
  104. package/src/components/inline-edit/inline-edit.scss +15 -2
  105. package/src/components/input/input.scss +1 -1
  106. package/src/components/item/item.component.ts +30 -19
  107. package/src/components/item/item.scss +57 -23
  108. package/src/components/linked-select/linked-select.component.ts +5 -1
  109. package/src/components/menu/menu.component.ts +1 -0
  110. package/src/components/menu/menu.scss +1 -1
  111. package/src/components/menu-item/menu-item.component.ts +22 -4
  112. package/src/components/menu-item/menu-item.scss +54 -7
  113. package/src/components/navbar/navbar.component.ts +7 -1
  114. package/src/components/navbar/navbar.scss +26 -16
  115. package/src/components/option/option.component.ts +4 -1
  116. package/src/components/option/option.scss +9 -0
  117. package/src/components/page-nav/page-nav.component.ts +2 -2
  118. package/src/components/page-nav/page-nav.scss +4 -4
  119. package/src/components/panel/panel.component.ts +20 -9
  120. package/src/components/panel/panel.scss +5 -1
  121. package/src/components/popup/popup.component.ts +16 -2
  122. package/src/components/progress-tile/progress-tile.component.ts +10 -4
  123. package/src/components/progress-tile/progress-tile.scss +7 -4
  124. package/src/components/query-builder/query-builder.component.ts +1 -1
  125. package/src/components/radio/radio.scss +1 -1
  126. package/src/components/scroll-container/scroll-container.component.ts +56 -9
  127. package/src/components/scroll-container/scroll-container.scss +37 -2
  128. package/src/components/select/select.component.ts +3 -0
  129. package/src/components/select/select.scss +1 -1
  130. package/src/components/settings-container/index.ts +12 -0
  131. package/src/components/settings-container/settings-container.component.ts +226 -0
  132. package/src/components/settings-container/settings-container.scss +99 -0
  133. package/src/components/settings-container/settings-container.test.ts +10 -0
  134. package/src/components/skeleton/skeleton.scss +5 -4
  135. package/src/components/sp/sp.component.ts +2 -0
  136. package/src/components/sp/sp.scss +2 -0
  137. package/src/components/split-button/split-button.component.ts +24 -18
  138. package/src/components/split-pane/split-pane.component.ts +5 -5
  139. package/src/components/stat/stat.component.ts +5 -1
  140. package/src/components/stat/stat.scss +24 -1
  141. package/src/components/style/style.component.ts +25 -1
  142. package/src/components/tabs/tabs.component.ts +12 -1
  143. package/src/components/textarea/textarea.component.ts +3 -1
  144. package/src/components/textarea/textarea.scss +21 -2
  145. package/src/components/vertical-stepper/vertical-stepper.scss +1 -1
  146. package/src/internal/form.ts +3 -1
  147. package/src/internal/slot.ts +29 -3
  148. package/src/utilities/on.ts +7 -8
  149. package/src/utilities/query.ts +5 -1
  150. package/src/wc.scss +7 -0
  151. package/src/zinc.ts +5 -0
  152. package/src/components/editor/modules/dialog-module/dialog-module.component.ts +0 -289
  153. package/src/components/editor/modules/dialog-module/dialog-module.scss +0 -115
  154. package/src/components/editor/modules/dialog-module/dialog-module.ts +0 -99
  155. package/src/components/editor/modules/events/zn-show-canned-response-dialog.ts +0 -15
  156. package/src/components/editor/modules/menu-module/menu-module.component.ts +0 -149
  157. package/src/components/editor/modules/menu-module/menu-module.scss +0 -17
  158. 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--top::part(popup) {
17
- transform-origin: bottom;
18
- }
16
+ .hover-container {
17
+ position: relative;
19
18
 
20
- .hover-container--bottom::part(popup) {
21
- transform-origin: top;
22
- }
19
+ &--top::part(popup) {
20
+ transform-origin: bottom;
21
+ }
23
22
 
24
- .hover-container--left::part(popup) {
25
- transform-origin: right;
26
- }
23
+ &--bottom::part(popup) {
24
+ transform-origin: top;
25
+ }
27
26
 
28
- .hover-container--right::part(popup) {
29
- transform-origin: left;
30
- }
27
+ &--left::part(popup) {
28
+ transform-origin: right;
29
+ }
31
30
 
32
- slot[slot='anchor'] {
33
- cursor: pointer;
34
- }
31
+ &--right::part(popup) {
32
+ transform-origin: left;
33
+ }
35
34
 
36
- .hover-container__body {
37
- flex-direction: column;
38
- z-index: 2;
39
- background-color: var(--zn-panel-background-color);
40
- border-radius: var(--zn-border-radius-large);
41
- border: 1px solid rgb(var(--zn-border-color));
42
- box-shadow: var(--zn-shadow-x-large);
43
- width: var(--width);
44
- max-width: calc(100% - var(--zn-spacing-2x-large));
45
- max-height: calc(100% - var(--zn-spacing-2x-large));
46
-
47
- ::slotted(*) {
48
- flex: 1 1 auto;
49
- display: block;
50
- overflow: auto;
51
- -webkit-overflow-scrolling: touch;
52
- color: var(--zn-color-text-default);
53
- font-size: var(--zn-font-size-medium);
54
- font-weight: var(--zn-font-weight-normal);
55
- letter-spacing: var(--zn-tracking-normal);
56
- line-height: var(--zn-line-height-dense);
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.6/dist/kubex-icons.css"
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,19 @@ 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);
108
+ this.addEventListener('mousedown', this.captureMouseDown, {capture: true});
109
+ this.addEventListener('keydown', this.captureKeyDown, {capture: true});
106
110
  }
107
111
 
108
112
  disconnectedCallback() {
109
113
  super.disconnectedCallback();
110
114
  document.removeEventListener('keydown', this.escKeyHandler);
115
+ document.removeEventListener('keydown', this.submitKeyHandler);
116
+ document.removeEventListener('click', this.mouseEventHandler);
117
+ this.removeEventListener('mousedown', this.captureMouseDown, true);
118
+ this.removeEventListener('keydown', this.captureKeyDown, true);
111
119
  }
112
120
 
113
121
  async firstUpdated() {
@@ -129,14 +137,46 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
129
137
  }
130
138
  }
131
139
 
140
+ mouseEventHandler = (e: MouseEvent) => {
141
+ if (this.isEditing && !this.contains(e.target as Node)) {
142
+ this.isEditing = false;
143
+ this.value = this.defaultValue;
144
+ this.input.blur();
145
+ }
146
+ };
147
+
132
148
  escKeyHandler = (e: KeyboardEvent) => {
133
149
  if (e.key === 'Escape' && this.isEditing) {
134
150
  this.isEditing = false;
135
151
  this.value = this.defaultValue;
152
+ this.input.blur();
136
153
  }
137
154
  };
138
155
 
139
- handleEditClick = () => {
156
+ submitKeyHandler = (e: KeyboardEvent) => {
157
+ if (e.key === 'Enter' && this.isEditing) {
158
+ this.isEditing = false;
159
+ this.formControlController.submit();
160
+ this.input.blur();
161
+ }
162
+ }
163
+
164
+ captureMouseDown = (e: MouseEvent) => {
165
+ if (this.disabled && !this.isEditing) {
166
+ e.stopPropagation();
167
+ }
168
+ }
169
+
170
+ captureKeyDown = (e: KeyboardEvent) => {
171
+ if (this.disabled && !this.isEditing) {
172
+ e.stopPropagation();
173
+ e.preventDefault();
174
+ }
175
+ }
176
+
177
+ handleEditClick = (e: MouseEvent) => {
178
+ e.preventDefault();
179
+ e.stopPropagation();
140
180
  if (this.disabled) {
141
181
  return;
142
182
  }
@@ -160,6 +200,9 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
160
200
  };
161
201
 
162
202
  handleInput = (e: Event) => {
203
+ if (this.disabled || !this.isEditing) {
204
+ return;
205
+ }
163
206
  this.value = (e.target as (HTMLInputElement | HTMLSelectElement)).value;
164
207
  };
165
208
 
@@ -201,7 +244,7 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
201
244
  'ai--padded': this.padded,
202
245
  })}">
203
246
 
204
- <div class="ai__left" @click="${this.handleEditClick}">
247
+ <div class="ai__left" @click="${this.disabled ? undefined : this.handleEditClick}">
205
248
  ${input}
206
249
  </div>
207
250
 
@@ -209,10 +252,11 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
209
252
  ${!this.isEditing ?
210
253
  html`
211
254
  ${hasEditText ? html`
212
- <zn-button @click="${this.handleEditClick}" size="x-small" color="secondary">
255
+ <zn-button @click="${this.disabled ? undefined : this.handleEditClick}" size="x-small"
256
+ color="secondary">
213
257
  ${this.editText}
214
258
  </zn-button>` : html`
215
- <zn-button @click="${this.handleEditClick}"
259
+ <zn-button @click="${this.disabled ? undefined : this.handleEditClick}"
216
260
  class="button--edit"
217
261
  icon="edit"
218
262
  size="x-small"
@@ -235,6 +279,7 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
235
279
  name="${this.name}"
236
280
  size="${this.size}"
237
281
  value="${this.value}"
282
+ placeholder="${this.placeholder}"
238
283
  help-text="${ifDefined(this.helpText)}"
239
284
  pattern=${ifDefined(this.pattern)}
240
285
  @zn-input="${this.handleInput}"
@@ -249,6 +294,7 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
249
294
  name="${this.name}"
250
295
  size="${this.size}"
251
296
  value="${this.value}"
297
+ placeholder="${this.placeholder}"
252
298
  help-text="${ifDefined(this.helpText)}"
253
299
  pattern=${ifDefined(this.pattern)}
254
300
  @zn-input="${this.handleInput}"
@@ -263,7 +309,7 @@ export default class ZnInlineEdit extends ZincElement implements ZincFormControl
263
309
  value="${this.value}"
264
310
  help-text="${ifDefined(this.helpText)}"
265
311
  size="${this.size}"
266
- placeholder=" ${this.placeholder}"
312
+ placeholder="${this.placeholder}"
267
313
  @zn-input="${this.handleInput}"
268
314
  @zn-blur="${this.handleBlur}">
269
315
  ${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
 
@@ -130,7 +133,17 @@
130
133
  }
131
134
  }
132
135
 
133
- &--disabled {
136
+ &--disabled:not(.ai--editing) {
137
+ .ai__input::part(input), .ai__input::part(combobox) {
138
+ text-decoration: none;
139
+ caret-color: transparent;
140
+ border-radius: 0;
141
+ }
142
+
143
+ .ai__input::part(display-input) {
144
+ cursor: text;
145
+ }
146
+
134
147
  .ai__right {
135
148
  display: none !important;
136
149
  }
@@ -12,7 +12,7 @@
12
12
  justify-content: start;
13
13
  position: relative;
14
14
  width: 100%;
15
- box-shadow: var(--zn-shadow-medium);
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
- 'description-item': true,
70
- 'description-item--stacked': this.stacked,
71
- 'description-item--edit-on-hover': this.editOnHover,
72
- 'description-item--inline': this.inline,
73
- 'description-item--grid': this.grid,
74
- 'description-item--small': this.size === 'small',
75
- 'description-item--medium': this.size === 'medium',
76
- 'description-item--large': this.size === 'large',
77
- 'description-item--has-icon': hasIcon,
78
- 'description-item--no-padding': this.noPadding
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="description-item__header">
84
- <div class="description-item__icon">
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
- <div class="description-item__caption" part="caption">${this.caption}</div>
88
- </div>` : html`
89
- <div class="description-item__caption" part="caption">${this.caption}</div>`}
99
+ ${headings}
100
+ </div>` : headings}
90
101
 
91
- <div class="description-item__content">
92
- <div class="description-item__content-inner">
102
+ <div class="item__content">
103
+ <div class="item__content-inner">
93
104
  <slot>${this.value}</slot>
94
105
  </div>
95
- <div class="description-item__action-wrapper">
96
- <slot name="actions" class="description-item__actions"></slot>
106
+ <div class="item__action-wrapper">
107
+ <slot name="actions" class="item__actions"></slot>
97
108
  </div>
98
109
  </div>
99
110
  </div>
@@ -4,13 +4,14 @@
4
4
  display: block;
5
5
  container-type: inline-size;
6
6
 
7
- --zn-item-label-max-width: 300px;
7
+ --zn-item-label-max-width: 450px;
8
8
  }
9
9
 
10
- .description-item {
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,11 +27,9 @@
26
27
  }
27
28
 
28
29
  &--has-icon {
29
- align-items: flex-start !important;
30
-
31
- .description-item__icon {
30
+ .item__icon {
32
31
  position: relative;
33
- line-height: 33px;
32
+ line-height: var(--zn-line-height-loose);
34
33
  display: flex;
35
34
  justify-content: center;
36
35
  margin-right: var(--zn-spacing-small);
@@ -38,43 +37,70 @@
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;
43
- max-width: var(--zn-item-label-max-width);
44
- width: 100%;
46
+ align-items: center;
45
47
 
46
- .description-item__caption {
48
+ .item__caption {
47
49
  width: unset;
48
50
  max-width: unset;
49
51
  }
50
52
  }
51
53
 
54
+ &__headings {
55
+ display: flex;
56
+ flex-direction: column;
57
+ max-width: 40%;
58
+ @include wc.container-query(null, sm) {
59
+ max-width: unset;
60
+ }
61
+ width: var(--zn-item-label-max-width);
62
+ flex-shrink: 0;
63
+ }
64
+
52
65
  &__content {
53
66
  width: 100%;
54
67
  display: flex;
55
68
  justify-content: space-between;
56
- line-height: 30px;
69
+ line-height: var(--zn-line-height-loose);
57
70
  }
58
71
 
59
72
  &__content-inner {
60
73
  width: 100%;
74
+
75
+ ::slotted(a) {
76
+ color: rgb(var(--zn-primary)) !important;
77
+ }
78
+
79
+ ::slotted(zn-icon) {
80
+ vertical-align: middle;
81
+ margin-right: var(--zn-spacing-2x-small);
82
+ }
61
83
  }
62
84
 
63
85
  &__caption {
64
86
  font-weight: 500;
65
87
  color: rgb(var(--zn-text-heading));
66
- line-height: 33px;
67
- max-width: var(--zn-item-label-max-width);
88
+ line-height: var(--zn-line-height-loose);
68
89
  width: 100%;
69
90
  flex-shrink: 0;
91
+ }
70
92
 
71
- @include wc.container-query(null, sm) {
72
- line-height: var(--zn-line-height-normal);
73
- }
93
+ &__description {
94
+ display: block;
95
+ font-weight: 400;
96
+ margin: var(--zn-spacing-2x-small) 0 0;
97
+ font-size: var(--zn-font-size-small);
98
+ color: rgb(var(--zn-text-color));
74
99
  }
75
100
 
76
101
  &__action-wrapper {
77
102
  display: inline-block;
103
+ align-content: center;
78
104
  }
79
105
 
80
106
  &__actions {
@@ -86,11 +112,11 @@
86
112
 
87
113
  // Sizes
88
114
  &--small {
89
- &.description-item {
115
+ &.item {
90
116
  padding: var(--zn-spacing-x-small);
91
117
  }
92
118
 
93
- .description-item__caption, .description-item__content-inner {
119
+ .item__caption, .item__content-inner {
94
120
  font-size: var(--zn-font-size-small);
95
121
  }
96
122
 
@@ -110,7 +136,7 @@
110
136
  display: none;
111
137
  }
112
138
 
113
- .description-item__actions {
139
+ .item__actions {
114
140
  display: none;
115
141
  }
116
142
 
@@ -119,30 +145,38 @@
119
145
  display: flex;
120
146
  }
121
147
 
122
- .description-item__actions {
148
+ .item__actions {
123
149
  display: flex;
124
150
  }
125
151
  }
126
152
  }
127
153
 
128
154
  &--inline {
129
-
130
155
  gap: var(--zn-spacing-small);
131
156
 
132
- .description-item__header {
157
+ .item__header {
133
158
  width: unset;
134
159
  max-width: unset;
135
160
  }
136
161
 
137
- .description-item__icon {
162
+ .item__icon {
138
163
  margin-right: 0;
139
164
  }
140
165
 
141
- .description-item__caption {
166
+ .item__caption {
142
167
  width: unset;
143
168
  max-width: unset;
144
169
  }
145
170
 
171
+ .item__headings {
172
+ width: unset;
173
+ max-width: unset;
174
+ }
175
+
176
+ .item__description {
177
+ margin: 0;
178
+ }
179
+
146
180
  @include wc.container-query(null, sm) {
147
181
  flex-direction: row;
148
182
  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: HTMLInputElement;
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
- filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.04)) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.1));
12
+ box-shadow: var(--zn-shadow-medium);
13
13
  background-color: rgb(var(--zn-panel, 255, 255, 255));
14
14
  }