@kubex/zinc 1.0.4 → 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.
Files changed (153) hide show
  1. package/dist/custom-elements.json +1034 -111
  2. package/dist/vscode.html-custom-data.json +85 -15
  3. package/dist/web-types.json +215 -24
  4. package/dist/zn.d.ts +1234 -888
  5. package/dist/zn.min.css +1 -1
  6. package/dist/zn.min.js +1979 -940
  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/button/button.component.ts +6 -2
  39. package/src/components/button/button.scss +16 -1
  40. package/src/components/button-menu/button-menu.component.ts +23 -15
  41. package/src/components/button-menu/button-menu.scss +4 -4
  42. package/src/components/checkbox/checkbox.component.ts +5 -1
  43. package/src/components/checkbox/checkbox.scss +1 -1
  44. package/src/components/chip/chip.component.ts +7 -3
  45. package/src/components/chip/chip.scss +9 -1
  46. package/src/components/collapsible/collapsible.component.ts +48 -2
  47. package/src/components/confirm/confirm.component.ts +1 -2
  48. package/src/components/content-block/content-block.component.ts +25 -1
  49. package/src/components/content-block/content-block.scss +8 -0
  50. package/src/components/data-select/data-select.component.ts +1 -1
  51. package/src/components/data-table/data-table.component.ts +361 -422
  52. package/src/components/data-table/data-table.scss +6 -1
  53. package/src/components/datepicker/datepicker.scss +1 -1
  54. package/src/components/dialog/dialog.component.ts +52 -33
  55. package/src/components/dialog/dialog.scss +15 -1
  56. package/src/components/dropdown/dropdown.component.ts +1 -1
  57. package/src/components/editor/editor.component.ts +196 -158
  58. package/src/components/editor/editor.scss +25 -5
  59. package/src/components/editor/modules/ai/index.ts +281 -0
  60. package/src/components/editor/modules/ai/panel/ai-panel.component.ts +102 -0
  61. package/src/components/editor/modules/ai/panel/ai-panel.scss +83 -0
  62. package/src/components/editor/modules/ai/tooltip/ai-tooltip.component.ts +30 -0
  63. package/src/components/editor/modules/ai/tooltip/ai-tooltip.scss +28 -0
  64. package/src/components/editor/modules/{attachment-module.ts → attachment/attachment.ts} +7 -7
  65. package/src/components/editor/modules/context-menu/context-menu-component.ts +115 -0
  66. package/src/components/editor/modules/context-menu/context-menu.scss +49 -0
  67. package/src/components/editor/modules/context-menu/context-menu.ts +296 -0
  68. package/src/components/editor/modules/context-menu/quick-action/index.ts +12 -0
  69. package/src/components/editor/modules/context-menu/quick-action/quick-action.component.ts +18 -0
  70. package/src/components/editor/modules/date-picker/date-picker.ts +77 -0
  71. package/src/components/editor/modules/dialog/dialog.component.ts +115 -0
  72. package/src/components/editor/modules/dialog/dialog.scss +43 -0
  73. package/src/components/editor/modules/dialog/dialog.ts +46 -0
  74. package/src/components/editor/modules/{drag-drop-module.ts → drag-drop/drag-drop.ts} +6 -6
  75. package/src/components/editor/modules/emoji/emoji.ts +106 -0
  76. package/src/components/editor/modules/emoji/headless/headless-emoji.component.ts +122 -0
  77. package/src/components/editor/modules/emoji/headless/headless-emoji.scss +52 -0
  78. package/src/components/editor/modules/emoji/headless/headless-emoji.ts +223 -0
  79. package/src/components/editor/modules/{image-resize-module/image-resize-module.ts → image-resize/image-resize.ts} +5 -5
  80. package/src/components/editor/modules/{time-tracking-module.ts → time-tracking/time-tracking.ts} +5 -5
  81. package/src/components/editor/modules/toolbar/tool/index.ts +12 -0
  82. package/src/components/editor/modules/toolbar/tool/tool.component.ts +30 -0
  83. package/src/components/editor/modules/toolbar/tool/tool.scss +5 -0
  84. package/src/components/editor/modules/toolbar/toolbar.component.ts +738 -0
  85. package/src/components/editor/modules/toolbar/toolbar.scss +98 -0
  86. package/src/components/editor/modules/toolbar/toolbar.ts +328 -0
  87. package/src/components/expanding-action/expanding-action.component.ts +2 -2
  88. package/src/components/expanding-action/expanding-action.scss +2 -2
  89. package/src/components/filter-wrapper/filter-wrapper.component.ts +91 -0
  90. package/src/components/filter-wrapper/filter-wrapper.scss +11 -0
  91. package/src/components/filter-wrapper/filter-wrapper.test.ts +10 -0
  92. package/src/components/filter-wrapper/index.ts +12 -0
  93. package/src/components/header/header.component.ts +1 -1
  94. package/src/components/header/header.scss +8 -1
  95. package/src/components/hover-container/hover-container.scss +39 -36
  96. package/src/components/icon/icon.component.ts +11 -5
  97. package/src/components/icon/icon.scss +15 -2
  98. package/src/components/inline-edit/inline-edit.component.ts +28 -3
  99. package/src/components/inline-edit/inline-edit.scss +4 -1
  100. package/src/components/input/input.scss +1 -1
  101. package/src/components/item/item.component.ts +30 -19
  102. package/src/components/item/item.scss +56 -14
  103. package/src/components/linked-select/linked-select.component.ts +5 -1
  104. package/src/components/menu/menu.component.ts +1 -0
  105. package/src/components/menu/menu.scss +1 -1
  106. package/src/components/menu-item/menu-item.component.ts +22 -4
  107. package/src/components/menu-item/menu-item.scss +54 -7
  108. package/src/components/navbar/navbar.component.ts +7 -1
  109. package/src/components/navbar/navbar.scss +26 -16
  110. package/src/components/option/option.component.ts +4 -1
  111. package/src/components/option/option.scss +9 -0
  112. package/src/components/page-nav/page-nav.component.ts +2 -2
  113. package/src/components/page-nav/page-nav.scss +4 -4
  114. package/src/components/panel/panel.component.ts +20 -9
  115. package/src/components/panel/panel.scss +5 -1
  116. package/src/components/popup/popup.component.ts +16 -2
  117. package/src/components/progress-tile/progress-tile.component.ts +10 -4
  118. package/src/components/progress-tile/progress-tile.scss +7 -4
  119. package/src/components/query-builder/query-builder.component.ts +1 -1
  120. package/src/components/radio/radio.scss +1 -1
  121. package/src/components/scroll-container/scroll-container.component.ts +56 -9
  122. package/src/components/scroll-container/scroll-container.scss +37 -2
  123. package/src/components/select/select.component.ts +3 -0
  124. package/src/components/select/select.scss +1 -1
  125. package/src/components/settings-container/index.ts +12 -0
  126. package/src/components/settings-container/settings-container.component.ts +226 -0
  127. package/src/components/settings-container/settings-container.scss +92 -0
  128. package/src/components/settings-container/settings-container.test.ts +10 -0
  129. package/src/components/skeleton/skeleton.scss +5 -4
  130. package/src/components/sp/sp.component.ts +2 -0
  131. package/src/components/sp/sp.scss +2 -0
  132. package/src/components/split-button/split-button.component.ts +24 -18
  133. package/src/components/split-pane/split-pane.component.ts +5 -5
  134. package/src/components/stat/stat.component.ts +5 -1
  135. package/src/components/stat/stat.scss +24 -1
  136. package/src/components/style/style.component.ts +18 -0
  137. package/src/components/tabs/tabs.component.ts +12 -1
  138. package/src/components/textarea/textarea.component.ts +3 -1
  139. package/src/components/textarea/textarea.scss +21 -2
  140. package/src/components/vertical-stepper/vertical-stepper.scss +1 -1
  141. package/src/internal/form.ts +3 -1
  142. package/src/internal/slot.ts +29 -3
  143. package/src/utilities/on.ts +7 -8
  144. package/src/utilities/query.ts +5 -1
  145. package/src/wc.scss +7 -0
  146. package/src/zinc.ts +5 -0
  147. package/src/components/editor/modules/dialog-module/dialog-module.component.ts +0 -289
  148. package/src/components/editor/modules/dialog-module/dialog-module.scss +0 -115
  149. package/src/components/editor/modules/dialog-module/dialog-module.ts +0 -99
  150. package/src/components/editor/modules/events/zn-show-canned-response-dialog.ts +0 -15
  151. package/src/components/editor/modules/menu-module/menu-module.component.ts +0 -149
  152. package/src/components/editor/modules/menu-module/menu-module.scss +0 -17
  153. package/src/components/editor/modules/menu-module/menu-module.ts +0 -203
@@ -1,5 +1,6 @@
1
1
  import {classMap} from "lit/directives/class-map.js";
2
2
  import {type CSSResultGroup, html, type PropertyValues, unsafeCSS} from 'lit';
3
+ import {deepQuerySelectorAll} from "../../utilities/query";
3
4
  import {property} from 'lit/decorators.js';
4
5
  import {watch} from "../../internal/watch";
5
6
  import ZincElement from '../../internal/zinc-element';
@@ -40,6 +41,8 @@ export default class ZnButtonMenu extends ZincElement {
40
41
 
41
42
  @property({}) size: 'content' | 'x-small' | 'small' | 'medium' | 'large' = 'medium';
42
43
 
44
+ @property({type: Number, attribute: 'icon-size', reflect: true}) iconSize: number = 24;
45
+
43
46
  @property({type: Boolean, attribute: 'no-gap'}) public noGap: boolean;
44
47
 
45
48
  @property({type: Boolean, attribute: 'no-padding'}) public noPadding: boolean;
@@ -174,6 +177,9 @@ export default class ZnButtonMenu extends ZincElement {
174
177
  if (!button.button.hasAttribute('color')) {
175
178
  button.button.setAttribute('color', button.button.hasAttribute('primary') ? 'primary' : button.button.hasAttribute('secondary') ? 'secondary' : 'transparent');
176
179
  }
180
+ if (button.button.hasAttribute('primary') || button.button.hasAttribute('secondary')) {
181
+ button.button.setAttribute('text', "");
182
+ }
177
183
  button.button.setAttribute('size', this.size);
178
184
  }
179
185
  });
@@ -256,8 +262,9 @@ export default class ZnButtonMenu extends ZincElement {
256
262
  }
257
263
  }
258
264
 
259
- // check if there are an zn-confirms attached
260
- const confirms: NodeListOf<ZnConfirm> = this.querySelectorAll('zn-confirm');
265
+ // check if there are any zn-confirms attached
266
+ // @ts-ignore
267
+ const confirms: NodeListOf<ZnConfirm> = deepQuerySelectorAll('zn-confirm', this, '');
261
268
  confirms.forEach(confirm => {
262
269
  confirm.updateTriggers(); // update the triggers for the confirm dialog
263
270
  })
@@ -272,7 +279,7 @@ export default class ZnButtonMenu extends ZincElement {
272
279
  })}>
273
280
  <div class="button-menu__container"></div>
274
281
  <zn-dropdown placement="bottom-end">
275
- <zn-button slot="trigger" icon="more_vert" icon-size="24" color="transparent" size="${this.size}"></zn-button>
282
+ <zn-button slot="trigger" icon="more_vert" icon-size="${this.iconSize}" color="transparent" size="${this.size}"></zn-button>
276
283
  <zn-menu></zn-menu>
277
284
  </zn-dropdown>
278
285
  <slot></slot>
@@ -331,21 +338,22 @@ export default class ZnButtonMenu extends ZincElement {
331
338
  }
332
339
 
333
340
  public removeAllButtons() {
334
- // remove all buttons that have the zn-button-menu__added class
335
- const buttons = this.querySelectorAll('.zn-button-menu__added');
336
- buttons.forEach((button: ZnButton) => {
337
- button.remove();
338
- });
341
+ const buttons = this.shadowRoot?.querySelectorAll('zn-button.zn-button-menu__added');
342
+ if (buttons) {
343
+ buttons.forEach((button: ZnButton) => {
344
+ button.remove();
345
+ });
346
+ }
339
347
 
340
- // remove all zn-menu-item elements
341
- const menuItems = this.shadowRoot?.querySelectorAll('zn-menu-item');
342
- menuItems?.forEach((menuItem: ZnMenuItem) => {
343
- menuItem.remove();
344
- });
348
+ const menuItems = this.shadowRoot?.querySelectorAll('zn-menu-item.zn-button-menu__added');
349
+ if (menuItems) {
350
+ menuItems?.forEach((menuItem: ZnMenuItem) => {
351
+ menuItem.remove();
352
+ });
353
+ }
345
354
 
346
- // reset the original buttons list
347
- this._originalButtons = [];
348
355
  this._buttons = [];
356
+ this._originalButtons = this._originalButtons.filter(b => !b.button.classList.contains('zn-button-menu__added'));
349
357
 
350
358
  // Recalculate the visible buttons
351
359
  this.calculateVisibleButtons();
@@ -3,7 +3,7 @@
3
3
  :host {
4
4
  display: block;
5
5
  max-width: 100%;
6
- --menu-gap: var(--zn-spacing-x-small);
6
+ --menu-gap: var(--zn-spacing-2x-small);
7
7
  }
8
8
 
9
9
  .button-menu--no-gap {
@@ -17,7 +17,7 @@
17
17
  padding: var(--zn-spacing-small) 0;
18
18
  margin: 0;
19
19
 
20
- min-width: 35px;
20
+ min-width: 34px;
21
21
  max-width: var(--zn-max-width);
22
22
 
23
23
  gap: var(--menu-gap);
@@ -31,11 +31,11 @@
31
31
  flex-direction: row;
32
32
  gap: var(--menu-gap);
33
33
  margin: 0;
34
- max-width: calc(100% - 35px);
34
+ max-width: calc(100% - 34px);
35
35
  }
36
36
 
37
37
  zn-button {
38
- min-width: 35px;
38
+ min-width: 34px;
39
39
  flex-shrink: 0;
40
40
  }
41
41
  }
@@ -7,9 +7,9 @@ import {ifDefined} from "lit/directives/if-defined.js";
7
7
  import {live} from "lit/directives/live.js";
8
8
  import {property, query, state} from 'lit/decorators.js';
9
9
  import {watch} from '../../internal/watch';
10
+ import type {ZincFormControl} from '../../internal/zinc-element';
10
11
  import ZincElement from '../../internal/zinc-element';
11
12
  import ZnIcon from "../icon";
12
- import type {ZincFormControl} from '../../internal/zinc-element';
13
13
 
14
14
  import styles from './checkbox.scss';
15
15
 
@@ -110,6 +110,10 @@ export default class ZnCheckbox extends ZincElement implements ZincFormControl {
110
110
  return this.input?.validity;
111
111
  }
112
112
 
113
+ get isChecked() {
114
+ return this.checked;
115
+ }
116
+
113
117
  /** Gets the validation message */
114
118
  get validationMessage() {
115
119
  return this.input.validationMessage;
@@ -57,7 +57,7 @@
57
57
  justify-content: center;
58
58
  width: var(--toggle-size);
59
59
  height: var(--toggle-size);
60
- box-shadow: var(--zn-shadow-medium);
60
+ box-shadow: var(--zn-shadow-x-small);
61
61
  border: solid var(--zn-input-border-width) var(--zn-input-border-color);
62
62
  border-radius: 2px;
63
63
  background-color: var(--zn-input-background-color);
@@ -40,9 +40,13 @@ export default class ZnChip extends ZincElement {
40
40
  private readonly hasSlotController = new HasSlotController(this, '[default]', 'action');
41
41
 
42
42
  render() {
43
+ const hasContent = this.hasSlotController.test('[default]')
43
44
  return html`
44
- <div class=${classMap({
45
+ <div class="${classMap({
45
46
  'chip': true,
47
+ 'chip--with-content': hasContent,
48
+ 'chip--no-content': !hasContent,
49
+ 'chip--with-icon': this.icon,
46
50
  'chip--flush': this.flush,
47
51
  'chip--flush-x': this.flushX,
48
52
  'chip--flush-y': this.flushY,
@@ -57,10 +61,10 @@ export default class ZnChip extends ZincElement {
57
61
  'chip--small': this.size === 'small',
58
62
  'chip--medium': this.size === 'medium',
59
63
  'chip--large': this.size === 'large',
60
- })}>
64
+ })}">
61
65
  ${this.icon ? html`
62
66
  <zn-icon src="${this.icon}" size="18"></zn-icon>` : ''}
63
- ${this.hasSlotController.test('[default]') ? html`
67
+ ${hasContent ? html`
64
68
  <slot></slot>` : ''}
65
69
  ${this.hasSlotController.test('action') ? html`
66
70
  <slot name="action" class="chip__action"></slot>` : ''}
@@ -7,7 +7,7 @@
7
7
  .chip {
8
8
  display: inline-flex;
9
9
  border-radius: 7px;
10
- padding: var(--zn-spacing-2x-small) var(--zn-spacing-x-small);
10
+ padding: var(--zn-spacing-3x-small) var(--zn-spacing-x-small);
11
11
  text-align: center;
12
12
  font-size: 12px;
13
13
  gap: 4px;
@@ -99,3 +99,11 @@
99
99
  font-size: var(--zn-font-size-large);
100
100
  padding: var(--zn-spacing-x-small) var(--zn-spacing-x-large);
101
101
  }
102
+
103
+ .chip--no-content {
104
+ padding: var(--zn-spacing-3x-small) var(--zn-spacing-2x-small);
105
+ }
106
+
107
+ .chip--with-icon {
108
+ padding-left: var(--zn-spacing-2x-small);
109
+ }
@@ -1,10 +1,11 @@
1
1
  import {classMap} from "lit/directives/class-map.js";
2
2
  import {type CSSResultGroup, html, unsafeCSS} from 'lit';
3
- import {property} from 'lit/decorators.js';
3
+ import {property, state} from 'lit/decorators.js';
4
4
  import {Store} from "../../internal/storage";
5
5
  import ZincElement from '../../internal/zinc-element';
6
6
 
7
7
  import styles from './collapsible.scss';
8
+ import {HasSlotController} from "../../internal/slot";
8
9
 
9
10
  /**
10
11
  * @summary Toggles between showing and hiding content when clicked
@@ -26,6 +27,11 @@ export default class ZnCollapsible extends ZincElement {
26
27
 
27
28
  @property({reflect: true}) label = '';
28
29
 
30
+ @property({type: Boolean, attribute: 'show-number', reflect: true}) showNumber: boolean = false;
31
+
32
+ // what element name to count
33
+ @property({type: String, attribute: 'count-element'}) countElement: string = '*';
34
+
29
35
  @property({type: Boolean, reflect: true}) expanded: boolean = false;
30
36
 
31
37
  @property({attribute: 'default'}) defaultState: 'open' | 'closed';
@@ -38,8 +44,14 @@ export default class ZnCollapsible extends ZincElement {
38
44
 
39
45
  @property({attribute: 'flush', type: Boolean, reflect: true}) flush: boolean = false;
40
46
 
47
+ @state() numberOfItems: number = 0;
48
+
41
49
  protected _store: Store;
42
50
 
51
+ private readonly hasSlotController = new HasSlotController(this, '[default]', 'header', 'caption', 'label');
52
+
53
+ private observer: MutationObserver;
54
+
43
55
  connectedCallback() {
44
56
  super.connectedCallback();
45
57
  this._store = new Store(this.localStorage ? window.localStorage : window.sessionStorage, "zncla:", this.storeTtl);
@@ -51,6 +63,22 @@ export default class ZnCollapsible extends ZincElement {
51
63
  this.expanded = hasPref === "true";
52
64
  }
53
65
  }
66
+
67
+ if (this.showNumber) {
68
+ // add a mutation observer to the default slot to recalculate the number of items when it changes
69
+ const slot = this as HTMLElement;
70
+ this.observer = new MutationObserver(() => {
71
+ this.recalculateNumberOfItems();
72
+ });
73
+ this.observer.observe(slot, {childList: true, subtree: true});
74
+ }
75
+ }
76
+
77
+ disconnectedCallback() {
78
+ super.disconnectedCallback();
79
+ if (this.observer) {
80
+ this.observer.disconnect();
81
+ }
54
82
  }
55
83
 
56
84
  handleCollapse = (e: MouseEvent) => {
@@ -60,7 +88,23 @@ export default class ZnCollapsible extends ZincElement {
60
88
  }
61
89
  }
62
90
 
91
+ public recalculateNumberOfItems = () => {
92
+ const assignedElements = this.hasSlotController.getDefaultSlot()
93
+ .filter(node => node.nodeType === Node.ELEMENT_NODE) as HTMLElement[];
94
+
95
+ // query all direct children that match the countElement tag name
96
+ if (this.countElement === '*') {
97
+ this.numberOfItems = assignedElements.length;
98
+ return;
99
+ }
100
+
101
+ const children = assignedElements.flatMap(el => Array.from(el.querySelectorAll(this.countElement)));
102
+ this.numberOfItems = children.length;
103
+ }
104
+
63
105
  render() {
106
+ this.recalculateNumberOfItems();
107
+
64
108
  return html`
65
109
  <div @click="${() => (!this.expanded ? (this.expanded = true) : '')}">
66
110
  <slot name="header" class="header" @click="${this.handleCollapse}">
@@ -72,6 +116,8 @@ export default class ZnCollapsible extends ZincElement {
72
116
  </div>
73
117
  <div class="header__right">
74
118
  <slot name="label"><p class="label">${this.label}</p></slot>
119
+ ${this.showNumber && !this.expanded ? html`
120
+ <zn-chip size="small" type="primary">${this.numberOfItems}</zn-chip>` : ''}
75
121
  <zn-icon library="material-outlined" src="expand_more" class="expand"></zn-icon>
76
122
  </div>
77
123
  </slot>
@@ -79,7 +125,7 @@ export default class ZnCollapsible extends ZincElement {
79
125
  'content': true,
80
126
  'content--flush': this.flush,
81
127
  })}">
82
- <slot></slot>
128
+ <slot @slotchange="${this.requestUpdate}"></slot>
83
129
  </div>
84
130
  </div>`;
85
131
  }
@@ -1,5 +1,6 @@
1
1
  import {classMap} from "lit/directives/class-map.js";
2
2
  import {type CSSResultGroup, html, type PropertyValues, unsafeCSS} from 'lit';
3
+ import {deepQuerySelectorAll} from "../../utilities/query";
3
4
  import {HasSlotController} from "../../internal/slot";
4
5
  import {ifDefined} from "lit/directives/if-defined.js";
5
6
  import {property, query} from 'lit/decorators.js';
@@ -7,7 +8,6 @@ import ZincElement from "../../internal/zinc-element";
7
8
  import ZnDialog from "../dialog";
8
9
 
9
10
  import styles from './confirm.scss';
10
- import {deepQuerySelectorAll} from "../../utilities/query";
11
11
 
12
12
  /**
13
13
  * @summary Short summary of the component's intended use.
@@ -85,7 +85,6 @@ export default class ZnConfirm extends ZincElement {
85
85
  connectedCallback() {
86
86
  super.connectedCallback();
87
87
 
88
-
89
88
  if (this.hasSlotController.test('trigger')) {
90
89
  const trigger = this.hasSlotController.getSlot('trigger');
91
90
  trigger?.addEventListener('click', this.show);
@@ -49,10 +49,34 @@ export default class ContentBlock extends ZincElement {
49
49
  convertedHtml = convertedHtml.replace(/&gt;/g, '>');
50
50
  convertedHtml = convertedHtml.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
51
51
 
52
- const baseStyles = "<style>body,html{padding: 0; margin: 0; font-size: 13px; font-family: Arial;}</style>";
52
+ const baseStyles = "<style>body,html{padding: 0; margin: 0; font-size: 13px; font-family: Arial;}img{max-width:100%; max-height: 500px;}</style>";
53
53
  iframe.srcdoc = baseStyles + convertedHtml;
54
54
  }
55
55
  }
56
+
57
+ iframe.addEventListener("load", () => {
58
+ // Save original styles
59
+ const originalDisplay = iframe.style.display;
60
+ const originalVisibility = iframe.style.visibility;
61
+ const originalPosition = iframe.style.position;
62
+
63
+ // Make iframe render but stay hidden
64
+ iframe.style.display = 'block';
65
+ iframe.style.visibility = 'hidden';
66
+ iframe.style.position = 'absolute';
67
+
68
+ setTimeout(() => {
69
+ const iframeBody = iframe.contentDocument?.body;
70
+ if (iframeBody) {
71
+ const height = iframeBody.scrollHeight;
72
+ iframe.style.height = `${height + 30}px`;
73
+ }
74
+ // Restore original styles
75
+ iframe.style.display = originalDisplay;
76
+ iframe.style.visibility = originalVisibility;
77
+ iframe.style.position = originalPosition;
78
+ }, 50);
79
+ });
56
80
  });
57
81
  }
58
82
 
@@ -1,3 +1,5 @@
1
+ @use "../../wc";
2
+
1
3
  :host {
2
4
  text-rendering: optimizeLegibility;
3
5
  -webkit-font-smoothing: antialiased;
@@ -45,6 +47,12 @@ zn-panel.content-block--short::part(mid) {
45
47
  display: none;
46
48
  }
47
49
 
50
+ zn-panel.content-block--short zn-header::part(header-description) {
51
+ @include wc.container-query(null, ph) {
52
+ display: none;
53
+ }
54
+ }
55
+
48
56
  zn-panel:not(.content-block--short) zn-header::part(header-description) {
49
57
  display: none;
50
58
  }
@@ -186,7 +186,7 @@ export default class ZnDataSelect extends ZincElement implements ZincFormControl
186
186
  @blur=${this.blur}
187
187
  value="${this.value}"
188
188
  placeholder="Choose a ${localProvider.getName}"
189
- exportparts="combobox,expand-icon,form-control-help-text,form-control-input">
189
+ exportparts="combobox,expand-icon,form-control-help-text,form-control-input,display-input">
190
190
  ${this.iconPosition !== 'none' ? html`
191
191
  <div id="select__prefix" slot="prefix" class="select__prefix"></div>` : ''}
192
192
  ${data.map((item: DataProviderOption) => html`