@siemens/ix 1.2.0 → 1.3.0-beta.0

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 (233) hide show
  1. package/dist/cjs/alignment-24ae2e63.js +1372 -0
  2. package/dist/cjs/index-17eb8998.js +4 -0
  3. package/dist/cjs/index.cjs.js +4 -1
  4. package/dist/cjs/ix-button.cjs.entry.js +4 -2
  5. package/dist/cjs/ix-category-filter.cjs.entry.js +8 -8
  6. package/dist/cjs/ix-chip.cjs.entry.js +21 -8
  7. package/dist/cjs/ix-counter-pill.cjs.entry.js +1 -1
  8. package/dist/cjs/ix-dropdown-button.cjs.entry.js +40 -0
  9. package/dist/cjs/ix-dropdown_2.cjs.entry.js +87 -41
  10. package/dist/cjs/ix-expanding-search.cjs.entry.js +2 -2
  11. package/dist/cjs/ix-icon-button.cjs.entry.js +2 -2
  12. package/dist/cjs/ix-map-navigation_2.cjs.entry.js +5 -4
  13. package/dist/cjs/ix-menu_9.cjs.entry.js +12 -93
  14. package/dist/cjs/ix-modal_2.cjs.entry.js +1 -1
  15. package/dist/cjs/ix-pill.cjs.entry.js +5 -2
  16. package/dist/cjs/ix-select_2.cjs.entry.js +35 -14
  17. package/dist/cjs/ix-split-button_2.cjs.entry.js +6 -35
  18. package/dist/cjs/ix-validation-tooltip.cjs.entry.js +71 -26
  19. package/dist/cjs/loader.cjs.js +1 -1
  20. package/dist/cjs/{modal-e4a6983d.js → modal-dda2f6be.js} +8 -2
  21. package/dist/cjs/siemens-ix.cjs.js +1 -1
  22. package/dist/cjs/theme-switcher-6b45e082.js +92 -0
  23. package/dist/collection/collection-manifest.json +1 -0
  24. package/dist/collection/components/button/button.css +1 -1
  25. package/dist/collection/components/button/button.js +5 -3
  26. package/dist/collection/components/category-filter/category-filter.css +4 -4
  27. package/dist/collection/components/category-filter/category-filter.js +7 -7
  28. package/dist/collection/components/chip/chip.css +20 -0
  29. package/dist/collection/components/chip/chip.js +22 -9
  30. package/dist/collection/components/counter-pill/counter-pill.css +10 -0
  31. package/dist/collection/components/dropdown/alignment.js +9 -0
  32. package/dist/collection/components/dropdown/dropdown.css +1 -0
  33. package/dist/collection/components/dropdown/dropdown.js +113 -50
  34. package/dist/collection/components/dropdown/placement.js +1 -0
  35. package/dist/collection/components/dropdown-button/dropdown-button.css +81 -0
  36. package/dist/collection/components/dropdown-button/dropdown-button.js +191 -0
  37. package/dist/collection/components/expanding-search/expanding-search.css +1 -0
  38. package/dist/collection/components/expanding-search/expanding-search.js +1 -1
  39. package/dist/collection/components/icon-button/icon-button.css +3 -30
  40. package/dist/collection/components/icon-button/icon-button.js +2 -2
  41. package/dist/collection/components/map-navigation/map-navigation.js +3 -2
  42. package/dist/collection/components/map-navigation-overlay/map-navigation-overlay.css +9 -4
  43. package/dist/collection/components/map-navigation-overlay/map-navigation-overlay.js +1 -1
  44. package/dist/collection/components/menu/menu.css +1 -1
  45. package/dist/collection/components/menu/menu.js +6 -21
  46. package/dist/collection/components/menu-avatar/menu-avatar.js +4 -30
  47. package/dist/collection/components/modal/modal.css +1 -0
  48. package/dist/collection/components/modal/modal.js +7 -1
  49. package/dist/collection/components/pill/pill.css +10 -0
  50. package/dist/collection/components/pill/pill.js +4 -1
  51. package/dist/collection/components/select/select.css +0 -3
  52. package/dist/collection/components/select/select.js +13 -12
  53. package/dist/collection/components/select-item/events.js +16 -0
  54. package/dist/collection/components/select-item/select-item.js +23 -4
  55. package/dist/collection/components/split-button/split-button.js +7 -36
  56. package/dist/collection/components/tree/tree.js +1 -1
  57. package/dist/collection/components/utils/theme-switcher.js +86 -0
  58. package/dist/collection/components/validation-tooltip/validation-tooltip.css +4 -24
  59. package/dist/collection/components/validation-tooltip/validation-tooltip.js +75 -28
  60. package/dist/collection/exports.js +1 -0
  61. package/dist/components/alignment.js +1363 -0
  62. package/dist/components/button.js +5 -3
  63. package/dist/components/dropdown.js +88 -41
  64. package/dist/components/icon-button.js +3 -3
  65. package/dist/components/index.d.ts +1 -0
  66. package/dist/components/index.js +2 -1
  67. package/dist/components/ix-category-filter.js +18 -12
  68. package/dist/components/ix-chip.js +21 -8
  69. package/dist/components/ix-counter-pill.js +1 -1
  70. package/dist/components/ix-dropdown-button.d.ts +11 -0
  71. package/dist/components/ix-dropdown-button.js +86 -0
  72. package/dist/components/ix-expanding-search.js +2 -2
  73. package/dist/components/ix-map-navigation.js +3 -2
  74. package/dist/components/ix-menu-avatar.js +6 -19
  75. package/dist/components/ix-menu.js +93 -46
  76. package/dist/components/ix-pill.js +5 -2
  77. package/dist/components/ix-select.js +9 -14
  78. package/dist/components/ix-split-button.js +6 -35
  79. package/dist/components/ix-validation-tooltip.js +74 -27
  80. package/dist/components/map-navigation-overlay.js +2 -2
  81. package/dist/components/modal.js +8 -2
  82. package/dist/components/select-item.js +27 -1
  83. package/dist/esm/alignment-f63c1b89.js +1363 -0
  84. package/dist/esm/index-6f4f3582.js +4 -0
  85. package/dist/esm/index.js +2 -1
  86. package/dist/esm/ix-button.entry.js +5 -3
  87. package/dist/esm/ix-category-filter.entry.js +8 -8
  88. package/dist/esm/ix-chip.entry.js +21 -8
  89. package/dist/esm/ix-counter-pill.entry.js +1 -1
  90. package/dist/esm/ix-dropdown-button.entry.js +36 -0
  91. package/dist/esm/ix-dropdown_2.entry.js +87 -41
  92. package/dist/esm/ix-expanding-search.entry.js +2 -2
  93. package/dist/esm/ix-icon-button.entry.js +3 -3
  94. package/dist/esm/ix-map-navigation_2.entry.js +5 -4
  95. package/dist/esm/ix-menu_9.entry.js +12 -93
  96. package/dist/esm/ix-modal_2.entry.js +1 -1
  97. package/dist/esm/ix-pill.entry.js +5 -2
  98. package/dist/esm/ix-select_2.entry.js +35 -14
  99. package/dist/esm/ix-split-button_2.entry.js +6 -35
  100. package/dist/esm/ix-validation-tooltip.entry.js +71 -26
  101. package/dist/esm/loader.js +1 -1
  102. package/dist/esm/{modal-e7343756.js → modal-df0a62f2.js} +8 -2
  103. package/dist/esm/siemens-ix.js +1 -1
  104. package/dist/esm/theme-switcher-dce1aaec.js +89 -0
  105. package/dist/siemens-ix/index.esm.js +1 -1
  106. package/dist/siemens-ix/p-03d38416.entry.js +1 -0
  107. package/dist/siemens-ix/p-0e357d27.entry.js +1 -0
  108. package/dist/siemens-ix/p-18d02e6f.entry.js +1 -0
  109. package/dist/siemens-ix/p-2bc72119.entry.js +1 -0
  110. package/dist/siemens-ix/p-2bd88760.entry.js +1 -0
  111. package/dist/siemens-ix/p-2c5abec1.js +1 -0
  112. package/dist/siemens-ix/p-35990ac7.js +1 -0
  113. package/dist/siemens-ix/p-43616759.entry.js +1 -0
  114. package/dist/siemens-ix/p-4fcb5f2b.entry.js +1 -0
  115. package/dist/siemens-ix/p-5631ae88.entry.js +1 -0
  116. package/dist/siemens-ix/p-5bbe9943.entry.js +1 -0
  117. package/dist/siemens-ix/p-6fe3bb9c.entry.js +1 -0
  118. package/dist/siemens-ix/{p-1cf3348f.entry.js → p-7f842cdc.entry.js} +1 -1
  119. package/dist/siemens-ix/p-ab7949ff.entry.js +1 -0
  120. package/dist/siemens-ix/p-b3d00feb.entry.js +1 -0
  121. package/dist/siemens-ix/p-d20119c1.entry.js +1 -0
  122. package/dist/siemens-ix/p-dec6114f.js +1 -0
  123. package/dist/siemens-ix/p-f35ce089.entry.js +1 -0
  124. package/dist/siemens-ix/siemens-ix.css +25 -3
  125. package/dist/siemens-ix/siemens-ix.esm.js +1 -1
  126. package/dist/types/components/button/button.d.ts +1 -1
  127. package/dist/types/components/category-filter/category-filter.d.ts +1 -0
  128. package/dist/types/components/chip/chip.d.ts +2 -1
  129. package/dist/types/components/dropdown/alignment.d.ts +2 -0
  130. package/dist/types/components/dropdown/dropdown.d.ts +19 -6
  131. package/dist/types/components/dropdown/placement.d.ts +8 -0
  132. package/dist/types/components/dropdown-button/dropdown-button.d.ts +37 -0
  133. package/dist/types/components/menu/menu.d.ts +0 -2
  134. package/dist/types/components/menu-avatar/menu-avatar.d.ts +1 -5
  135. package/dist/types/components/modal/modal.d.ts +1 -0
  136. package/dist/types/components/select/select.d.ts +2 -1
  137. package/dist/types/components/select-item/events.d.ts +9 -0
  138. package/dist/types/components/select-item/select-item.d.ts +3 -2
  139. package/dist/types/components/split-button/split-button.d.ts +4 -6
  140. package/dist/types/components/tree/tree.d.ts +1 -1
  141. package/dist/types/components/utils/theme-switcher.d.ts +19 -0
  142. package/dist/types/components/validation-tooltip/validation-tooltip.d.ts +12 -4
  143. package/dist/types/components.d.ts +88 -17
  144. package/dist/types/exports.d.ts +1 -0
  145. package/package.json +5 -6
  146. package/scss/components/_buttons.scss +23 -0
  147. package/scss/components/_dropdown.scss +2 -0
  148. package/dist/cjs/popper-d7a0f999.js +0 -1801
  149. package/dist/collection/components/utils/popover.util.js +0 -33
  150. package/dist/collection/components/utils/toggle-theme.js +0 -24
  151. package/dist/components/popover.util.js +0 -36
  152. package/dist/components/popper.js +0 -1799
  153. package/dist/esm/popper-42db9fbd.js +0 -1799
  154. package/dist/siemens-ix/p-0a8cfa42.entry.js +0 -1
  155. package/dist/siemens-ix/p-16e95211.entry.js +0 -1
  156. package/dist/siemens-ix/p-1fe97752.entry.js +0 -1
  157. package/dist/siemens-ix/p-23d5469a.entry.js +0 -1
  158. package/dist/siemens-ix/p-47d55e3d.entry.js +0 -1
  159. package/dist/siemens-ix/p-537f0678.entry.js +0 -1
  160. package/dist/siemens-ix/p-5e222be2.entry.js +0 -1
  161. package/dist/siemens-ix/p-7adc0686.entry.js +0 -1
  162. package/dist/siemens-ix/p-94604cdf.js +0 -1
  163. package/dist/siemens-ix/p-9566c834.entry.js +0 -1
  164. package/dist/siemens-ix/p-9e90827e.entry.js +0 -1
  165. package/dist/siemens-ix/p-a12f6079.entry.js +0 -1
  166. package/dist/siemens-ix/p-c0fecc2b.entry.js +0 -1
  167. package/dist/siemens-ix/p-d8688602.entry.js +0 -1
  168. package/dist/siemens-ix/p-f86fcdf4.js +0 -1
  169. package/dist/types/components/utils/popover.util.d.ts +0 -9
  170. package/dist/types/components/utils/toggle-theme.d.ts +0 -1
  171. package/src/components/animated-tab/readme.md +0 -24
  172. package/src/components/animated-tabs/readme.md +0 -31
  173. package/src/components/application-header/readme.md +0 -21
  174. package/src/components/basic-navigation/readme.md +0 -22
  175. package/src/components/blind/readme.md +0 -29
  176. package/src/components/breadcrumb/readme.md +0 -33
  177. package/src/components/breadcrumb-item/readme.md +0 -22
  178. package/src/components/button/readme.md +0 -27
  179. package/src/components/category-filter/readme.md +0 -39
  180. package/src/components/chip/readme.md +0 -36
  181. package/src/components/counter-pill/readme.md +0 -25
  182. package/src/components/date-picker/readme.md +0 -53
  183. package/src/components/date-time-card/readme.md +0 -22
  184. package/src/components/datetime-picker/readme.md +0 -45
  185. package/src/components/drawer/readme.md +0 -47
  186. package/src/components/dropdown/readme.md +0 -49
  187. package/src/components/dropdown-item/readme.md +0 -45
  188. package/src/components/event-list/readme.md +0 -24
  189. package/src/components/event-list-item/readme.md +0 -32
  190. package/src/components/expanding-search/readme.md +0 -32
  191. package/src/components/filter-chip/readme.md +0 -30
  192. package/src/components/flip-tile/readme.md +0 -22
  193. package/src/components/flip-tile-content/readme.md +0 -14
  194. package/src/components/group/readme.md +0 -14
  195. package/src/components/group-dropdown-item/readme.md +0 -22
  196. package/src/components/group-item/readme.md +0 -34
  197. package/src/components/icon/readme.md +0 -23
  198. package/src/components/icon-button/readme.md +0 -31
  199. package/src/components/input-group/readme.md +0 -14
  200. package/src/components/kpi/readme.md +0 -27
  201. package/src/components/map-navigation/readme.md +0 -54
  202. package/src/components/map-navigation-overlay/readme.md +0 -30
  203. package/src/components/menu/readme.md +0 -86
  204. package/src/components/menu-about/readme.md +0 -30
  205. package/src/components/menu-about-item/readme.md +0 -21
  206. package/src/components/menu-about-news/readme.md +0 -34
  207. package/src/components/menu-avatar/readme.md +0 -30
  208. package/src/components/menu-avatar-item/readme.md +0 -29
  209. package/src/components/menu-item/readme.md +0 -26
  210. package/src/components/menu-settings/readme.md +0 -30
  211. package/src/components/menu-settings-item/readme.md +0 -21
  212. package/src/components/message-bar/readme.md +0 -31
  213. package/src/components/modal/readme.md +0 -67
  214. package/src/components/modal-container/readme.md +0 -29
  215. package/src/components/my-component/readme.md +0 -16
  216. package/src/components/pill/readme.md +0 -26
  217. package/src/components/select/readme.md +0 -37
  218. package/src/components/select-item/readme.md +0 -44
  219. package/src/components/spinner/readme.md +0 -22
  220. package/src/components/split-button/readme.md +0 -36
  221. package/src/components/split-button-item/readme.md +0 -29
  222. package/src/components/tab-item/readme.md +0 -28
  223. package/src/components/tabs/readme.md +0 -25
  224. package/src/components/tile/readme.md +0 -21
  225. package/src/components/time-picker/readme.md +0 -51
  226. package/src/components/toast/readme.md +0 -36
  227. package/src/components/toggle/readme.md +0 -35
  228. package/src/components/tree/readme.md +0 -32
  229. package/src/components/tree-item/readme.md +0 -31
  230. package/src/components/upload/readme.md +0 -51
  231. package/src/components/validation-tooltip/readme.md +0 -31
  232. package/src/components/workflow-step/readme.md +0 -28
  233. package/src/components/workflow-steps/readme.md +0 -33
@@ -94,7 +94,7 @@ ix-menu .menu-overlay {
94
94
  -webkit-backdrop-filter: blur(1rem);
95
95
  backdrop-filter: blur(1rem);
96
96
  background-color: var(--theme-sidebar-overlay-blur);
97
- transition: all 150ms ease-out;
97
+ transition: all 300ms ease-out;
98
98
  }
99
99
  ix-menu .menu-overlay-invisible {
100
100
  display: none;
@@ -7,9 +7,8 @@
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
9
  import { h, Host, } from '@stencil/core';
10
- import { Popover } from '../utils/popover.util';
11
10
  import { convertToRemString } from '../utils/rwd.util';
12
- import { toggleVariant } from '../utils/toggle-theme';
11
+ import { themeSwitcher } from '../utils/theme-switcher';
13
12
  export class Menu {
14
13
  constructor() {
15
14
  this.domObserver = new MutationObserver(this.onDomChange.bind(this));
@@ -131,10 +130,6 @@ export class Menu {
131
130
  }
132
131
  componentDidLoad() {
133
132
  var _a, _b, _c, _d;
134
- const anchor = this.hostElement.querySelector('#more-tab');
135
- this.popoverListener = new Popover(anchor, this.moreItemsDropdown, () => {
136
- this.showMoreItems = false;
137
- });
138
133
  (_a = this.settings) === null || _a === void 0 ? void 0 : _a.addEventListener('close', () => {
139
134
  this.showSettings = false;
140
135
  this.settings.show = this.showSettings;
@@ -163,10 +158,7 @@ export class Menu {
163
158
  subtree: true,
164
159
  });
165
160
  }
166
- disconnectedCallback() {
167
- var _a;
168
- (_a = this.popoverListener) === null || _a === void 0 ? void 0 : _a.destroy();
169
- }
161
+ disconnectedCallback() { }
170
162
  componentWillRender() {
171
163
  this.appendTabs();
172
164
  }
@@ -329,13 +321,6 @@ export class Menu {
329
321
  }
330
322
  return Math.min(visibleCount - 2, this.maxVisibleMenuItems);
331
323
  }
332
- toggleShowMoreDropdown() {
333
- if (this.moreItemsDropdown.querySelectorAll('.appended').length === 0) {
334
- return;
335
- }
336
- this.popoverListener.open();
337
- this.showMoreItems = !this.showMoreItems;
338
- }
339
324
  /**
340
325
  * Toggle map sidebar expand
341
326
  * @param show
@@ -451,7 +436,7 @@ export class Menu {
451
436
  isMenuItemClicked(event) {
452
437
  const path = event.composedPath();
453
438
  const menuItems = path
454
- .filter((element) => element.id !== 'more-tab')
439
+ .filter((element) => element.id !== 'ix-menu-more-tab')
455
440
  .filter((element) => {
456
441
  return element.tagName === 'IX-MENU-ITEM';
457
442
  });
@@ -474,11 +459,11 @@ export class Menu {
474
459
  if (this.isMenuItemClicked(event)) {
475
460
  this.resetOverlay();
476
461
  }
477
- } }, h("div", { class: "tabs-top" }), h("slot", null), h("div", { class: "active-more-tab" }, this.activeTab ? (h("ix-menu-item", { class: "internal-tab", active: true, tabIcon: this.activeTab.tabIcon }, this.activeTab.innerText)) : null), h("ix-menu-item", { id: "more-tab", tabIcon: "more-menu", class: {
462
+ } }, h("div", { class: "tabs-top" }), h("slot", null), h("div", { class: "active-more-tab" }, this.activeTab ? (h("ix-menu-item", { class: "internal-tab", active: true, tabIcon: this.activeTab.tabIcon }, this.activeTab.innerText)) : null), h("ix-menu-item", { id: "ix-menu-more-tab", tabIcon: "more-menu", class: {
478
463
  'internal-tab': true,
479
464
  }, style: {
480
465
  display: this.showMoreButton() ? 'block' : 'none',
481
- }, title: "Show more", notifications: this.countMoreNotifications, onClick: () => this.toggleShowMoreDropdown() }, this.i18nMore, h("ix-dropdown", { show: this.showMoreItems }, this.menuItems
466
+ }, title: "Show more", notifications: this.countMoreNotifications }, this.i18nMore, h("ix-dropdown", { trigger: 'ix-menu-more-tab', positioningStrategy: 'fixed', placement: 'right-start' }, this.menuItems
482
467
  .filter((elm, index) => !this.showTab(index) &&
483
468
  !this.isMenuItemActive(elm) &&
484
469
  this.isVisible(elm))
@@ -492,7 +477,7 @@ export class Menu {
492
477
  'internal-tab': true,
493
478
  'bottom-tab': true,
494
479
  active: this.showAbout,
495
- }, tabIcon: "info", onClick: async () => this.toggleAbout(!this.showAbout) }, this.i18nLegal)) : null, this.enableToggleTheme ? (h("ix-menu-item", { id: "toggleTheme", onClick: () => toggleVariant(), class: "internal-tab bottom-tab", tabIcon: "bulb" }, this.i18nToggleTheme)) : null, this.enableMapExpand ? (h("ix-menu-item", { id: "menu-collapse", onClick: () => this.mapExpandChange.emit(this.mapExpand), class: "internal-tab bottom-tab", tabIcon: `${this.getCollapseIcon()}` }, this.getCollapseText())) : null), h("div", { class: {
480
+ }, tabIcon: "info", onClick: async () => this.toggleAbout(!this.showAbout) }, this.i18nLegal)) : null, this.enableToggleTheme ? (h("ix-menu-item", { id: "toggleTheme", onClick: () => themeSwitcher.toggleMode(), class: "internal-tab bottom-tab", tabIcon: "bulb" }, this.i18nToggleTheme)) : null, this.enableMapExpand ? (h("ix-menu-item", { id: "menu-collapse", onClick: () => this.mapExpandChange.emit(this.mapExpand), class: "internal-tab bottom-tab", tabIcon: `${this.getCollapseIcon()}` }, this.getCollapseText())) : null), h("div", { class: {
496
481
  'menu-overlay': true,
497
482
  expanded: this.expand,
498
483
  'd-block': this.showAbout || this.showSettings,
@@ -7,29 +7,17 @@
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
9
  import { h, Host, } from '@stencil/core';
10
- import { Popover } from '../utils/popover.util';
11
10
  export class MenuAvatar {
12
11
  constructor() {
13
- this.displayMenu = undefined;
12
+ this.avatarElementId = 'ix-menu-avatar-id';
14
13
  this.top = undefined;
15
14
  this.bottom = undefined;
16
15
  this.i18nLogout = 'Logout';
17
16
  }
18
- toggleMenu() {
19
- this.outsideListener.open();
20
- this.displayMenu = !this.displayMenu;
21
- }
22
- componentDidLoad() {
23
- this.outsideListener = new Popover(this.hostElement, this.hostElement.querySelector('ix-dropdown'), () => {
24
- this.displayMenu = false;
25
- });
26
- }
27
- disconnectedCallback() {
28
- var _a;
29
- (_a = this.outsideListener) === null || _a === void 0 ? void 0 : _a.destroy();
30
- }
31
17
  render() {
32
- return (h(Host, null, h("li", { class: "nav-item top-item avatar no-hover", title: this.top }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 32 32" }, h("g", { fill: "none", "fill-rule": "evenodd" }, h("path", { id: "avatar-path-background", d: "M16 0C7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163\n 16-16c0-4.243-1.686-8.313-4.686-11.314C24.314 1.686 20.244 0 16 0z" }), h("path", { id: "avatar-path-person", d: "M17.897 17.91c3.8-.018 7.358 1.875 9.485 5.046-2.417 3.999-6.734 6.434-11.382\n 6.42-4.648.014-8.965-2.421-11.382-6.42 2.127-3.171 5.685-5.064\n 9.485-5.045h3.794zM15.821 2.129c3.682 0 6.667 2.984 6.667 6.666 0 3.682-2.985\n 6.667-6.667 6.667s-6.667-2.985-6.667-6.667 2.985-6.666 6.667-6.666z" }))), h("div", { class: "avatar-name" }, h("span", { class: "text-default-single", title: this.top }, this.top), h("span", { class: "text-default-single", title: this.bottom }, this.bottom))), h("ix-dropdown", { show: this.displayMenu }, h("slot", null), h("ix-menu-avatar-item", { label: this.i18nLogout, icon: "log-out", onClick: (e) => {
18
+ return (h(Host, null, h("li", { class: "nav-item top-item avatar no-hover", title: this.top, id: this.avatarElementId }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 32 32" }, h("g", { fill: "none", "fill-rule": "evenodd" }, h("path", { id: "avatar-path-background", d: "M16 0C7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163\n 16-16c0-4.243-1.686-8.313-4.686-11.314C24.314 1.686 20.244 0 16 0z" }), h("path", { id: "avatar-path-person", d: "M17.897 17.91c3.8-.018 7.358 1.875 9.485 5.046-2.417 3.999-6.734 6.434-11.382\n 6.42-4.648.014-8.965-2.421-11.382-6.42 2.127-3.171 5.685-5.064\n 9.485-5.045h3.794zM15.821 2.129c3.682 0 6.667 2.984 6.667 6.666 0 3.682-2.985\n 6.667-6.667 6.667s-6.667-2.985-6.667-6.667 2.985-6.666 6.667-6.666z" }))), h("div", { class: "avatar-name" }, h("span", { class: "text-default-single", title: this.top }, this.top), h("span", { class: "text-default-single", title: this.bottom }, this.bottom))), h("ix-dropdown", { trigger: this.avatarElementId, placement: 'right-start', offset: {
19
+ mainAxis: 12,
20
+ } }, h("slot", null), h("ix-menu-avatar-item", { label: this.i18nLogout, icon: "log-out", onClick: (e) => {
33
21
  this.logoutClick.emit(e);
34
22
  } }))));
35
23
  }
@@ -101,11 +89,6 @@ export class MenuAvatar {
101
89
  }
102
90
  };
103
91
  }
104
- static get states() {
105
- return {
106
- "displayMenu": {}
107
- };
108
- }
109
92
  static get events() {
110
93
  return [{
111
94
  "method": "logoutClick",
@@ -125,13 +108,4 @@ export class MenuAvatar {
125
108
  }];
126
109
  }
127
110
  static get elementRef() { return "hostElement"; }
128
- static get listeners() {
129
- return [{
130
- "name": "click",
131
- "method": "toggleMenu",
132
- "target": undefined,
133
- "capture": false,
134
- "passive": true
135
- }];
136
- }
137
111
  }
@@ -55,6 +55,7 @@
55
55
  background-color: var(--theme-modal--background);
56
56
  border: var(--modal--border-thickness) solid var(--theme-modal--border-color);
57
57
  padding: 1.5rem;
58
+ max-height: 100vh;
58
59
  }
59
60
  :host .modal .modal-content .state-icon-container {
60
61
  -webkit-margin-end: 1rem;
@@ -66,9 +66,15 @@ export class Modal {
66
66
  },
67
67
  });
68
68
  }
69
+ onBackdropClick(event) {
70
+ const target = event.target;
71
+ if (target.classList.contains('backdrop')) {
72
+ this.dismiss(event);
73
+ }
74
+ }
69
75
  componentDidLoad() {
70
76
  if (this.backdrop === 'static') {
71
- this.modalBackdrop.addEventListener('click', this.dismiss.bind(this));
77
+ this.modalBackdrop.addEventListener('click', (event) => this.onBackdropClick(event));
72
78
  }
73
79
  if (this.backdropClass) {
74
80
  this.modalBackdrop.classList.add(this.backdropClass);
@@ -36,6 +36,8 @@
36
36
  */
37
37
  :host {
38
38
  display: inline-flex;
39
+ width: -moz-fit-content;
40
+ width: fit-content;
39
41
  position: relative;
40
42
  align-items: center;
41
43
  justify-content: center;
@@ -262,8 +264,16 @@
262
264
  :host[variant=success].outline.active, :host[variant=success].outline:active {
263
265
  background-color: var(--theme-chip-outline--background--active);
264
266
  }
267
+ :host[variant=custom].outline {
268
+ border: solid 1px transparent;
269
+ background-color: transparent;
270
+ }
265
271
  :host .slot {
266
272
  overflow: hidden;
267
273
  text-overflow: ellipsis;
268
274
  white-space: nowrap;
275
+ }
276
+ :host .hidden {
277
+ width: 0px;
278
+ margin-right: 0px;
269
279
  }
@@ -25,7 +25,10 @@ export class Pill {
25
25
  color: this.color,
26
26
  backgroundColor: this.background,
27
27
  }
28
- : {}, title: this.el.textContent }, this.icon ? (h("ix-icon", { class: 'with-icon', name: this.icon, size: '16' })) : null, h("div", { class: "slot" }, h("slot", null))));
28
+ : {}, title: this.el.textContent }, h("ix-icon", { class: {
29
+ 'with-icon': true,
30
+ hidden: this.icon === undefined || this.icon === '',
31
+ }, name: this.icon, size: '16' }), h("div", { class: "slot" }, h("slot", null))));
29
32
  }
30
33
  static get is() { return "ix-pill"; }
31
34
  static get encapsulation() { return "scoped"; }
@@ -163,7 +163,4 @@
163
163
  height: 2rem;
164
164
  color: var(--theme-select-list-item-hint--color);
165
165
  margin: 0 0.5rem 0 2rem;
166
- }
167
- :host ix-dropdown {
168
- background-color: var(--theme-select-list--background);
169
166
  }
@@ -112,17 +112,12 @@ export class Select {
112
112
  : [this.selectedIndices]);
113
113
  }
114
114
  }
115
- componentDidLoad() {
116
- this.labelMutationObserver = new MutationObserver(() => {
117
- this.selectValue(Array.isArray(this.selectedIndices)
118
- ? this.selectedIndices
119
- : [this.selectedIndices]);
120
- });
121
- this.labelMutationObserver.observe(this.hostElement, {
122
- subtree: true,
123
- attributes: true,
124
- attributeFilter: ['label'],
125
- });
115
+ onLabelChange(event) {
116
+ event.preventDefault();
117
+ event.stopImmediatePropagation();
118
+ this.selectValue(Array.isArray(this.selectedIndices)
119
+ ? this.selectedIndices
120
+ : [this.selectedIndices]);
126
121
  }
127
122
  disconnectedCallback() {
128
123
  if (this.labelMutationObserver) {
@@ -259,7 +254,7 @@ export class Select {
259
254
  'd-none': this.disabled ||
260
255
  this.readonly ||
261
256
  (this.isDropdownEmpty && !this.editable),
262
- }, anchor: this.dropdownAnchor, trigger: this.dropdownWrapperRef, onShowChanged: (e) => this.dropdownVisibilityChanged(e), placement: "bottom", positioningStrategy: 'fixed', adjustDropdownWidthToReferenceWidth: true }, h("div", { class: "select-list-header", title: this.i18nSelectListHeader }, this.i18nSelectListHeader), h("slot", null), h("div", { ref: (ref) => (this.addItemRef = ref), class: "d-contents" }), this.itemExists(this.inputFilterText) ? ('') : (h("ix-dropdown-item", { "data-testid": "add-item", icon: "plus", class: {
257
+ }, anchor: this.dropdownAnchor, trigger: this.dropdownWrapperRef, onShowChanged: (e) => this.dropdownVisibilityChanged(e), placement: "bottom-start", positioningStrategy: 'absolute' }, h("div", { class: "select-list-header", title: this.i18nSelectListHeader }, this.i18nSelectListHeader), h("slot", null), h("div", { ref: (ref) => (this.addItemRef = ref), class: "d-contents" }), this.itemExists(this.inputFilterText) ? ('') : (h("ix-dropdown-item", { "data-testid": "add-item", icon: "plus", class: {
263
258
  'add-item': true,
264
259
  'd-none': !(this.editable && this.inputFilterText),
265
260
  }, label: this.inputFilterText, onItemClick: (e) => {
@@ -509,6 +504,12 @@ export class Select {
509
504
  "target": undefined,
510
505
  "capture": false,
511
506
  "passive": false
507
+ }, {
508
+ "name": "ix-select-item:labelChange",
509
+ "method": "onLabelChange",
510
+ "target": undefined,
511
+ "capture": false,
512
+ "passive": false
512
513
  }, {
513
514
  "name": "keydown",
514
515
  "method": "onKeyDown",
@@ -0,0 +1,16 @@
1
+ /*
2
+ * SPDX-FileCopyrightText: 2023 Siemens AG
3
+ *
4
+ * SPDX-License-Identifier: MIT
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ export class IxSelectItemLabelChangeEvent extends CustomEvent {
10
+ constructor(detail) {
11
+ super('ix-select-item:labelChange', {
12
+ bubbles: true,
13
+ detail,
14
+ });
15
+ }
16
+ }
@@ -7,6 +7,7 @@
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
9
  import { h, Host, } from '@stencil/core';
10
+ import { IxSelectItemLabelChangeEvent } from './events';
10
11
  export class SelectItem {
11
12
  constructor() {
12
13
  this.label = undefined;
@@ -15,7 +16,7 @@ export class SelectItem {
15
16
  this.hover = false;
16
17
  }
17
18
  /**
18
- * Internal
19
+ * @internal
19
20
  * @param event
20
21
  */
21
22
  async onItemClick(event) {
@@ -28,6 +29,12 @@ export class SelectItem {
28
29
  throw Error('ix-select-item must have a `value` property');
29
30
  }
30
31
  }
32
+ labelChange(newValue, oldValue) {
33
+ this.hostElement.dispatchEvent(new IxSelectItemLabelChangeEvent({
34
+ newValue: newValue,
35
+ oldValue: oldValue,
36
+ }));
37
+ }
31
38
  render() {
32
39
  return (h(Host, null, h("ix-dropdown-item", { checked: this.selected, hover: this.hover, label: this.label ? this.label : this.value, onItemClick: (e) => this.onItemClick(e) })));
33
40
  }
@@ -108,8 +115,11 @@ export class SelectItem {
108
115
  "required": false,
109
116
  "optional": false,
110
117
  "docs": {
111
- "tags": [],
112
- "text": "***Internal***"
118
+ "tags": [{
119
+ "name": "internal",
120
+ "text": undefined
121
+ }],
122
+ "text": ""
113
123
  },
114
124
  "attribute": "hover",
115
125
  "reflect": false,
@@ -161,8 +171,11 @@ export class SelectItem {
161
171
  "return": "Promise<void>"
162
172
  },
163
173
  "docs": {
164
- "text": "Internal",
174
+ "text": "",
165
175
  "tags": [{
176
+ "name": "internal",
177
+ "text": undefined
178
+ }, {
166
179
  "name": "param",
167
180
  "text": "event"
168
181
  }]
@@ -171,4 +184,10 @@ export class SelectItem {
171
184
  };
172
185
  }
173
186
  static get elementRef() { return "hostElement"; }
187
+ static get watchers() {
188
+ return [{
189
+ "propName": "label",
190
+ "methodName": "labelChange"
191
+ }];
192
+ }
174
193
  }
@@ -6,7 +6,6 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { createPopper, } from '@popperjs/core';
10
9
  import { h, Host, } from '@stencil/core';
11
10
  import { getButtonClasses } from '../button/base-button';
12
11
  export class SplitButton {
@@ -25,46 +24,18 @@ export class SplitButton {
25
24
  get splitItems() {
26
25
  return Array.from(this.hostElement.querySelectorAll('ix-split-button-item'));
27
26
  }
28
- clickOutside(e) {
29
- if (!this.hostElement.contains(e.target)) {
30
- this.toggle = false;
27
+ linkTriggerRef() {
28
+ if (this.triggerElement && this.dropdownElement) {
29
+ this.dropdownElement.trigger = this.triggerElement;
31
30
  }
32
31
  }
33
32
  componentDidLoad() {
34
- const element = this.hostElement.querySelector('.anchor');
35
- this.popover = this.hostElement.querySelector('ix-dropdown');
36
- this.popperInstance = createPopper(element, this.popover, {
37
- strategy: 'fixed',
38
- placement: this.placement,
39
- modifiers: [
40
- {
41
- name: 'offset',
42
- options: {
43
- offset: [0, 0],
44
- },
45
- },
46
- {
47
- name: 'flip',
48
- options: {
49
- padding: 8,
50
- },
51
- },
52
- ],
53
- });
54
- window.addEventListener('click', this.clickOutside.bind(this));
55
- }
56
- disconnectedCallback() {
57
- var _a;
58
- (_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.destroy();
59
- window.removeEventListener('click', this.clickOutside.bind(this));
60
- }
61
- toggleDropdown() {
62
- this.toggle = !this.toggle;
33
+ this.linkTriggerRef();
63
34
  }
64
35
  render() {
65
- return (h(Host, { class: "btn-group" }, h("button", { class: getButtonClasses(this.variant, this.outline, this.ghost || this.invisible, !this.label, false, false, this.disabled), onClick: (e) => this.buttonClick.emit(e) }, this.icon ? h("ix-icon", { name: this.icon }) : null, " ", this.label), h("button", { class: Object.assign(Object.assign({}, getButtonClasses(this.variant, this.outline, this.ghost || this.invisible, true, false, false, this.disabled)), {
36
+ return (h(Host, { class: "btn-group" }, h("button", { class: getButtonClasses(this.variant, this.outline, this.ghost || this.invisible, !this.label, false, false, this.disabled), onClick: (e) => this.buttonClick.emit(e) }, this.icon ? h("ix-icon", { name: this.icon }) : null, " ", this.label), h("button", { ref: (r) => (this.triggerElement = r), class: Object.assign(Object.assign({}, getButtonClasses(this.variant, this.outline, this.ghost || this.invisible, true, false, false, this.disabled)), {
66
37
  anchor: true,
67
- }), onClick: () => this.toggleDropdown() }, h("ix-icon", { name: this.splitIcon }), h("ix-dropdown", { show: this.toggle }, h("slot", null)))));
38
+ }) }, h("ix-icon", { name: this.splitIcon }), h("ix-dropdown", { ref: (r) => (this.dropdownElement = r) }, h("slot", null)))));
68
39
  }
69
40
  static get is() { return "ix-split-button"; }
70
41
  static get encapsulation() { return "scoped"; }
@@ -240,7 +211,7 @@ export class SplitButton {
240
211
  "references": {
241
212
  "Placement": {
242
213
  "location": "import",
243
- "path": "@popperjs/core"
214
+ "path": "../dropdown/placement"
244
215
  }
245
216
  }
246
217
  },
@@ -198,7 +198,7 @@ export class Tree {
198
198
  "optional": false,
199
199
  "docs": {
200
200
  "tags": [],
201
- "text": "Tree modal"
201
+ "text": "Tree model"
202
202
  }
203
203
  },
204
204
  "renderItem": {
@@ -0,0 +1,86 @@
1
+ import { TypedEvent } from './typed-event';
2
+ export class ThemeSwitcher {
3
+ constructor() {
4
+ this.prefixTheme = 'theme-';
5
+ this.suffixLight = '-light';
6
+ this.suffixDark = '-dark';
7
+ this.defaultTheme = 'theme-classic-dark';
8
+ this._themeChanged = new TypedEvent();
9
+ this.registerMutationObserver();
10
+ }
11
+ get themeChanged() {
12
+ return this._themeChanged;
13
+ }
14
+ hasVariantSuffix(className) {
15
+ return (className.endsWith(this.suffixDark) ||
16
+ className.endsWith(this.suffixLight));
17
+ }
18
+ isThemeClass(className) {
19
+ return (className.startsWith(this.prefixTheme) && this.hasVariantSuffix(className));
20
+ }
21
+ setTheme(themeName) {
22
+ if (!this.isThemeClass(themeName)) {
23
+ throw Error(`Provided theme name ${themeName} does not match our naming conventions. (theme-<name>-(dark,light))`);
24
+ }
25
+ const oldThemes = [];
26
+ document.body.classList.forEach((className) => {
27
+ if (this.isThemeClass(className)) {
28
+ oldThemes.push(className);
29
+ }
30
+ });
31
+ document.body.classList.remove(...oldThemes);
32
+ document.body.classList.add(themeName);
33
+ }
34
+ toggleMode() {
35
+ const oldThemes = [];
36
+ document.body.classList.forEach((className) => {
37
+ if (this.isThemeClass(className)) {
38
+ oldThemes.push(className);
39
+ }
40
+ });
41
+ if (oldThemes.length === 0) {
42
+ document.body.classList.add(this.getOppositeMode(this.defaultTheme));
43
+ return;
44
+ }
45
+ oldThemes.forEach((themeName) => {
46
+ document.body.classList.replace(themeName, this.getOppositeMode(themeName));
47
+ });
48
+ }
49
+ getOppositeMode(themeName) {
50
+ if (themeName.endsWith(this.suffixDark)) {
51
+ return themeName.replace(/-dark$/g, this.suffixLight);
52
+ }
53
+ if (themeName.endsWith(this.suffixLight)) {
54
+ return themeName.replace(/-light$/g, this.suffixDark);
55
+ }
56
+ }
57
+ handleMutations(mutations) {
58
+ return mutations.forEach((mutation) => {
59
+ const { target } = mutation;
60
+ target.classList.forEach((className) => {
61
+ var _a;
62
+ if (this.isThemeClass(className) &&
63
+ !((_a = mutation.oldValue) === null || _a === void 0 ? void 0 : _a.includes(className))) {
64
+ this._themeChanged.emit(className);
65
+ }
66
+ });
67
+ });
68
+ }
69
+ registerMutationObserver() {
70
+ if (typeof window === 'undefined') {
71
+ return;
72
+ }
73
+ if (!('MutationOberver' in window)) {
74
+ console.warn('ThemeSwitcher not supported by your browser. Missing MutationObserver API');
75
+ return;
76
+ }
77
+ this.mutationObserver = new MutationObserver((mutations) => {
78
+ this.handleMutations(mutations);
79
+ });
80
+ this.mutationObserver.observe(document.body, {
81
+ attributeFilter: ['class'],
82
+ attributeOldValue: true,
83
+ });
84
+ }
85
+ }
86
+ export const themeSwitcher = new ThemeSwitcher();
@@ -179,7 +179,8 @@ a {
179
179
  }
180
180
 
181
181
  :host {
182
- display: block;
182
+ display: inline-block;
183
+ position: relative;
183
184
  }
184
185
  :host .validation-tooltip {
185
186
  background-color: var(--theme-tootlip--background);
@@ -206,31 +207,10 @@ a {
206
207
  transform: rotate(45deg);
207
208
  background-color: var(--theme-tootlip--background);
208
209
  }
209
- :host .validation-tooltip[data-popper-placement^=top] > #arrow {
210
+ :host .validation-tooltip > #arrow {
210
211
  bottom: -5px;
211
212
  }
212
- :host .validation-tooltip[data-popper-placement^=top] > #arrow::before {
213
+ :host .validation-tooltip > #arrow::before {
213
214
  border-right: 1px solid var(--theme-tooltip--border-color);
214
215
  border-bottom: 1px solid var(--theme-tooltip--border-color);
215
- }
216
- :host .validation-tooltip[data-popper-placement^=bottom] > #arrow {
217
- top: -5px;
218
- }
219
- :host .validation-tooltip[data-popper-placement^=bottom] > #arrow::before {
220
- border-left: 1px solid var(--theme-tooltip--border-color);
221
- border-top: 1px solid var(--theme-tooltip--border-color);
222
- }
223
- :host .validation-tooltip[data-popper-placement^=left] > #arrow {
224
- right: -5px;
225
- }
226
- :host .validation-tooltip[data-popper-placement^=left] > #arrow::before {
227
- border-right: 1px solid var(--theme-tooltip--border-color);
228
- border-top: 1px solid var(--theme-tooltip--border-color);
229
- }
230
- :host .validation-tooltip[data-popper-placement^=right] > #arrow {
231
- left: -5px;
232
- }
233
- :host .validation-tooltip[data-popper-placement^=right] > #arrow::before {
234
- border-left: 1px solid var(--theme-tooltip--border-color);
235
- border-bottom: 1px solid var(--theme-tooltip--border-color);
236
216
  }