@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
@@ -6,67 +6,65 @@
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';
9
+ import { autoPlacement, autoUpdate, computePosition, inline, offset, shift, } from '@floating-ui/dom';
10
10
  import { h, Host, } from '@stencil/core';
11
+ import { getAlignment } from './alignment';
11
12
  export class Dropdown {
12
13
  constructor() {
14
+ this.autoUpdateCleanup = null;
13
15
  this.show = false;
14
16
  this.trigger = undefined;
15
17
  this.anchor = undefined;
16
18
  this.closeBehavior = 'both';
17
- this.placement = 'bottom-end';
19
+ this.placement = 'bottom-start';
18
20
  this.positioningStrategy = 'fixed';
19
21
  this.adjustDropdownWidthToReferenceWith = false;
20
22
  this.adjustDropdownWidthToReferenceWidth = false;
21
23
  this.header = undefined;
24
+ this.offset = undefined;
22
25
  this.openBind = this.open.bind(this);
23
26
  }
24
27
  get dropdownItems() {
25
28
  return Array.from(this.hostElement.querySelectorAll('ix-dropdown-item'));
26
29
  }
27
- resolveElement(prop) {
28
- if (typeof prop === 'string') {
29
- return document.querySelector('#' + prop);
30
+ async registerListener(element) {
31
+ this.triggerElement = await this.resolveElement(element);
32
+ if (this.triggerElement) {
33
+ this.triggerElement.addEventListener('click', this.openBind);
30
34
  }
31
- return prop;
32
35
  }
33
- async componentDidLoad() {
34
- if (this.trigger) {
35
- this.registerListener(this.trigger);
36
- }
37
- }
38
- registerListener(element) {
39
- this.triggerElement = this.resolveElement(element);
40
- this.triggerElement.addEventListener('click', this.openBind);
41
- }
42
- unregisterListener(element) {
43
- const trigger = this.resolveElement(element);
36
+ async unregisterListener(element) {
37
+ const trigger = await this.resolveElement(element);
44
38
  trigger.removeEventListener('click', this.openBind);
45
39
  }
46
- componentDidRender() {
47
- var _a;
48
- (_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.update();
40
+ resolveElement(element) {
41
+ if (typeof element !== 'string') {
42
+ return Promise.resolve(element);
43
+ }
44
+ const selector = `#${element}`;
45
+ return new Promise((resolve) => {
46
+ if (document.querySelector(selector)) {
47
+ return resolve(document.querySelector(selector));
48
+ }
49
+ const observer = new MutationObserver(() => {
50
+ if (document.querySelector(selector)) {
51
+ resolve(document.querySelector(selector));
52
+ observer.disconnect();
53
+ }
54
+ });
55
+ observer.observe(document.body, {
56
+ childList: true,
57
+ subtree: true,
58
+ });
59
+ });
49
60
  }
50
61
  async changedShow(newShow) {
51
- var _a;
52
62
  if (newShow) {
53
- this.anchorElement = this.anchor
63
+ this.anchorElement = await (this.anchor
54
64
  ? this.resolveElement(this.anchor)
55
- : this.resolveElement(this.trigger);
65
+ : this.resolveElement(this.trigger));
56
66
  if (this.anchorElement) {
57
- (_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.destroy();
58
- this.popperInstance = createPopper(this.anchorElement, this.dropdownRef, {
59
- placement: this.placement,
60
- strategy: this.positioningStrategy,
61
- onFirstUpdate: ({ elements }) => {
62
- if (this.adjustDropdownWidthToReferenceWith ||
63
- this.adjustDropdownWidthToReferenceWidth) {
64
- const { popper, reference } = elements;
65
- const width = reference.getBoundingClientRect().width;
66
- popper.style.width = `${width}px`;
67
- }
68
- },
69
- });
67
+ this.applyDropdownPosition();
70
68
  }
71
69
  }
72
70
  }
@@ -111,16 +109,64 @@ export class Dropdown {
111
109
  this.show = false;
112
110
  this.showChanged.emit(this.show);
113
111
  }
112
+ async applyDropdownPosition() {
113
+ if (this.anchorElement && this.dropdownRef) {
114
+ let positionConfig = {
115
+ strategy: this.positioningStrategy,
116
+ middleware: [],
117
+ };
118
+ if (this.placement.includes('auto')) {
119
+ positionConfig.middleware.push(autoPlacement({
120
+ alignment: getAlignment(this.placement),
121
+ }));
122
+ }
123
+ else {
124
+ positionConfig.placement = this.placement;
125
+ }
126
+ positionConfig.middleware = [
127
+ ...positionConfig.middleware,
128
+ inline(),
129
+ shift(),
130
+ ];
131
+ if (this.offset) {
132
+ positionConfig.middleware.push(offset(this.offset));
133
+ }
134
+ if (this.autoUpdateCleanup) {
135
+ this.autoUpdateCleanup();
136
+ this.autoUpdateCleanup = null;
137
+ }
138
+ this.autoUpdateCleanup = autoUpdate(this.anchorElement, this.dropdownRef, async () => {
139
+ const computeResponse = await computePosition(this.anchorElement, this.dropdownRef, positionConfig);
140
+ Object.assign(this.dropdownRef.style, {
141
+ top: '0',
142
+ left: '0',
143
+ transform: `translate(${Math.round(computeResponse.x)}px,${Math.round(computeResponse.y)}px)`,
144
+ });
145
+ }, {
146
+ ancestorResize: true,
147
+ ancestorScroll: true,
148
+ elementResize: true,
149
+ });
150
+ }
151
+ }
152
+ async componentDidLoad() {
153
+ if (this.trigger) {
154
+ this.registerListener(this.trigger);
155
+ }
156
+ }
157
+ async componentDidRender() {
158
+ await this.applyDropdownPosition();
159
+ }
114
160
  disconnectedCallback() {
115
- var _a;
116
- (_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.destroy();
161
+ if (this.autoUpdateCleanup) {
162
+ this.autoUpdateCleanup();
163
+ }
117
164
  }
118
165
  /**
119
166
  * Update position of dropdown
120
167
  */
121
168
  async updatePosition() {
122
- var _a;
123
- await ((_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.update());
169
+ this.applyDropdownPosition();
124
170
  }
125
171
  render() {
126
172
  return (h(Host, { ref: (ref) => (this.dropdownRef = ref), class: {
@@ -129,6 +175,7 @@ export class Dropdown {
129
175
  }, style: {
130
176
  margin: '0',
131
177
  minWidth: '0px',
178
+ position: this.positioningStrategy,
132
179
  } }, h("div", { style: { display: 'contents' } }, this.header ? h("div", { class: "dropdown-header" }, this.header) : '', h("slot", null))));
133
180
  }
134
181
  static get is() { return "ix-dropdown"; }
@@ -232,7 +279,7 @@ export class Dropdown {
232
279
  "references": {
233
280
  "Placement": {
234
281
  "location": "import",
235
- "path": "@popperjs/core"
282
+ "path": "./placement"
236
283
  }
237
284
  }
238
285
  },
@@ -244,20 +291,15 @@ export class Dropdown {
244
291
  },
245
292
  "attribute": "placement",
246
293
  "reflect": false,
247
- "defaultValue": "'bottom-end'"
294
+ "defaultValue": "'bottom-start'"
248
295
  },
249
296
  "positioningStrategy": {
250
297
  "type": "string",
251
298
  "mutable": false,
252
299
  "complexType": {
253
- "original": "PositioningStrategy",
300
+ "original": "'absolute' | 'fixed'",
254
301
  "resolved": "\"absolute\" | \"fixed\"",
255
- "references": {
256
- "PositioningStrategy": {
257
- "location": "import",
258
- "path": "@popperjs/core"
259
- }
260
- }
302
+ "references": {}
261
303
  },
262
304
  "required": false,
263
305
  "optional": false,
@@ -301,7 +343,10 @@ export class Dropdown {
301
343
  "required": false,
302
344
  "optional": false,
303
345
  "docs": {
304
- "tags": [],
346
+ "tags": [{
347
+ "name": "deprecated",
348
+ "text": "Will be removed. Not used anymore"
349
+ }],
305
350
  "text": "Adjust dropdown width to the parent width"
306
351
  },
307
352
  "attribute": "adjust-dropdown-width-to-reference-width",
@@ -324,6 +369,24 @@ export class Dropdown {
324
369
  },
325
370
  "attribute": "header",
326
371
  "reflect": false
372
+ },
373
+ "offset": {
374
+ "type": "unknown",
375
+ "mutable": false,
376
+ "complexType": {
377
+ "original": "{\n mainAxis?: number;\n crossAxis?: number;\n alignmentAxis?: number;\n }",
378
+ "resolved": "{ mainAxis?: number; crossAxis?: number; alignmentAxis?: number; }",
379
+ "references": {}
380
+ },
381
+ "required": false,
382
+ "optional": false,
383
+ "docs": {
384
+ "tags": [{
385
+ "name": "internal",
386
+ "text": undefined
387
+ }],
388
+ "text": "Move dropdown along main axis of alignment"
389
+ }
327
390
  }
328
391
  };
329
392
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,81 @@
1
+ /*
2
+ * SPDX-FileCopyrightText: 2022 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
+ /*
10
+ * SPDX-FileCopyrightText: 2022 Siemens AG
11
+ *
12
+ * SPDX-License-Identifier: MIT
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ */
17
+ /* Dimensions */
18
+ /* Font sizes */
19
+ /* Line heights */
20
+ /* Animation timings */
21
+ :host {
22
+ display: inline-block;
23
+ position: relative;
24
+ height: 2rem;
25
+ }
26
+ :host .dropdown-button {
27
+ position: relative;
28
+ }
29
+ :host .hide {
30
+ display: none;
31
+ }
32
+ :host .triangle {
33
+ position: absolute;
34
+ -webkit-margin-start: 1.5625rem;
35
+ margin-inline-start: 1.5625rem;
36
+ -webkit-margin-before: -0.4375rem;
37
+ margin-block-start: -0.4375rem;
38
+ border-right: 0 solid transparent;
39
+ border-left: 4px solid transparent;
40
+ border-top: 0 solid transparent;
41
+ border-bottom: 4px solid;
42
+ color: var(--theme-btn-primary--color);
43
+ }
44
+ :host .triangle.primary.ghost {
45
+ color: var(--theme-btn-invisible-primary--color);
46
+ }
47
+ :host .triangle.primary.outline {
48
+ color: var(--theme-btn-outline-primary--color);
49
+ }
50
+ :host .triangle.primary.ghost.disabled {
51
+ color: var(--theme-btn-invisible-primary--color--disabled);
52
+ }
53
+ :host .triangle.primary.outline.disabled {
54
+ color: var(--theme-btn-outline-primary--color--disabled);
55
+ }
56
+ :host .triangle.primary.disabled {
57
+ color: var(--theme-btn-primary--color--disabled);
58
+ }
59
+ :host .triangle.secondary.ghost {
60
+ color: var(--theme-btn-invisible-secondary--color);
61
+ }
62
+ :host .triangle.secondary.outline {
63
+ color: var(--theme-btn-outline-secondary--color);
64
+ }
65
+ :host .triangle.secondary.ghost.disabled {
66
+ color: var(--theme-btn-invisible-secondary--color--disabled);
67
+ }
68
+ :host .triangle.secondary.outline.disabled {
69
+ color: var(--theme-btn-outline-secondary--color--disabled);
70
+ }
71
+ :host .triangle.secondary.disabled {
72
+ color: var(--theme-btn-secondary--color--disabled);
73
+ }
74
+ :host .hide {
75
+ display: none;
76
+ }
77
+ :host .dropdown {
78
+ width: auto !important;
79
+ inset: auto !important;
80
+ transform: unset !important;
81
+ }
@@ -0,0 +1,191 @@
1
+ /*
2
+ * SPDX-FileCopyrightText: 2022 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
+ import { h, Host } from '@stencil/core';
10
+ /**
11
+ * @since 1.3.0
12
+ */
13
+ export class DropdownButton {
14
+ constructor() {
15
+ this.variant = 'Primary';
16
+ this.outline = false;
17
+ this.ghost = false;
18
+ this.active = false;
19
+ this.disabled = false;
20
+ this.label = '';
21
+ this.icon = undefined;
22
+ this.dropdownAnchor = undefined;
23
+ }
24
+ getTriangle() {
25
+ return (h("div", { class: {
26
+ triangle: true,
27
+ hide: this.label !== '',
28
+ primary: this.variant === 'Primary',
29
+ secondary: this.variant === 'Secondary',
30
+ ghost: this.ghost,
31
+ outline: this.outline,
32
+ disabled: this.disabled,
33
+ } }));
34
+ }
35
+ render() {
36
+ return (h(Host, null, h("div", { class: "dropdown-button", ref: (ref) => {
37
+ this.dropdownAnchor = ref;
38
+ } }, h("ix-button", { variant: this.variant, outline: this.outline, ghost: this.ghost, disabled: this.disabled, class: { hide: this.label === '' } }, h("ix-icon", { name: this.icon, size: "24", class: { hide: this.icon === '' || this.icon === undefined } }), this.label, h("ix-icon", { name: "chevron-down-small", size: "24" })), h("ix-icon-button", { icon: this.icon, variant: this.variant, outline: this.outline, ghost: this.ghost, disabled: this.disabled, class: { hide: this.label !== '' } }), this.getTriangle()), h("ix-dropdown", { class: "dropdown", trigger: this.dropdownAnchor, placement: "bottom", positioningStrategy: 'fixed', adjustDropdownWidthToReferenceWidth: true }, h("slot", null))));
39
+ }
40
+ static get is() { return "ix-dropdown-button"; }
41
+ static get encapsulation() { return "scoped"; }
42
+ static get originalStyleUrls() {
43
+ return {
44
+ "$": ["dropdown-button.scss"]
45
+ };
46
+ }
47
+ static get styleUrls() {
48
+ return {
49
+ "$": ["dropdown-button.css"]
50
+ };
51
+ }
52
+ static get properties() {
53
+ return {
54
+ "variant": {
55
+ "type": "string",
56
+ "mutable": false,
57
+ "complexType": {
58
+ "original": "Buttons",
59
+ "resolved": "\"Primary\" | \"Secondary\"",
60
+ "references": {
61
+ "Buttons": {
62
+ "location": "import",
63
+ "path": "../utils/button-variants"
64
+ }
65
+ }
66
+ },
67
+ "required": false,
68
+ "optional": false,
69
+ "docs": {
70
+ "tags": [],
71
+ "text": "Button varaint"
72
+ },
73
+ "attribute": "variant",
74
+ "reflect": false,
75
+ "defaultValue": "'Primary'"
76
+ },
77
+ "outline": {
78
+ "type": "boolean",
79
+ "mutable": false,
80
+ "complexType": {
81
+ "original": "boolean",
82
+ "resolved": "boolean",
83
+ "references": {}
84
+ },
85
+ "required": false,
86
+ "optional": false,
87
+ "docs": {
88
+ "tags": [],
89
+ "text": "Outline button"
90
+ },
91
+ "attribute": "outline",
92
+ "reflect": false,
93
+ "defaultValue": "false"
94
+ },
95
+ "ghost": {
96
+ "type": "boolean",
97
+ "mutable": false,
98
+ "complexType": {
99
+ "original": "boolean",
100
+ "resolved": "boolean",
101
+ "references": {}
102
+ },
103
+ "required": false,
104
+ "optional": false,
105
+ "docs": {
106
+ "tags": [],
107
+ "text": "Button with no background or outline"
108
+ },
109
+ "attribute": "ghost",
110
+ "reflect": false,
111
+ "defaultValue": "false"
112
+ },
113
+ "active": {
114
+ "type": "boolean",
115
+ "mutable": false,
116
+ "complexType": {
117
+ "original": "boolean",
118
+ "resolved": "boolean",
119
+ "references": {}
120
+ },
121
+ "required": false,
122
+ "optional": false,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": "Active button"
126
+ },
127
+ "attribute": "active",
128
+ "reflect": false,
129
+ "defaultValue": "false"
130
+ },
131
+ "disabled": {
132
+ "type": "boolean",
133
+ "mutable": false,
134
+ "complexType": {
135
+ "original": "boolean",
136
+ "resolved": "boolean",
137
+ "references": {}
138
+ },
139
+ "required": false,
140
+ "optional": false,
141
+ "docs": {
142
+ "tags": [],
143
+ "text": "Disable button"
144
+ },
145
+ "attribute": "disabled",
146
+ "reflect": false,
147
+ "defaultValue": "false"
148
+ },
149
+ "label": {
150
+ "type": "string",
151
+ "mutable": false,
152
+ "complexType": {
153
+ "original": "string",
154
+ "resolved": "string",
155
+ "references": {}
156
+ },
157
+ "required": false,
158
+ "optional": false,
159
+ "docs": {
160
+ "tags": [],
161
+ "text": "Set label"
162
+ },
163
+ "attribute": "label",
164
+ "reflect": false,
165
+ "defaultValue": "''"
166
+ },
167
+ "icon": {
168
+ "type": "string",
169
+ "mutable": false,
170
+ "complexType": {
171
+ "original": "string",
172
+ "resolved": "string",
173
+ "references": {}
174
+ },
175
+ "required": false,
176
+ "optional": false,
177
+ "docs": {
178
+ "tags": [],
179
+ "text": "Button icon"
180
+ },
181
+ "attribute": "icon",
182
+ "reflect": false
183
+ }
184
+ };
185
+ }
186
+ static get states() {
187
+ return {
188
+ "dropdownAnchor": {}
189
+ };
190
+ }
191
+ }
@@ -114,6 +114,7 @@
114
114
  position: absolute;
115
115
  border-radius: var(--theme-input--border-radius);
116
116
  right: 0px;
117
+ margin-right: 0.25rem;
117
118
  }
118
119
  :host .input {
119
120
  padding-left: 2rem !important;
@@ -74,7 +74,7 @@ export class ExpandingSearch {
74
74
  }, ref: (el) => (this.textInput = el), "data-testid": "input", placeholder: this.placeholder, type: "text", value: this.value, onBlur: () => {
75
75
  this.collapseInput();
76
76
  this.hasFocus = false;
77
- }, onFocus: () => (this.hasFocus = true), onInput: (e) => this.onChange(e), tabindex: this.expanded ? 0 : -1 }), this.isFieldChanged ? (h("ix-icon-button", { class: "btn-clear", icon: "clear", ghost: true, size: "24", "data-testid": "clear-button", onClick: () => this.clearClicked() })) : null)));
77
+ }, onFocus: () => (this.hasFocus = true), onInput: (e) => this.onChange(e), tabindex: this.expanded ? 0 : -1 }), this.isFieldChanged ? (h("ix-icon-button", { class: "btn-clear", icon: "clear", ghost: true, size: "16", "data-testid": "clear-button", onClick: () => this.clearClicked() })) : null)));
78
78
  }
79
79
  static get is() { return "ix-expanding-search"; }
80
80
  static get encapsulation() { return "scoped"; }
@@ -6,37 +6,10 @@
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
- /*
10
- * SPDX-FileCopyrightText: 2022 Siemens AG
11
- *
12
- * SPDX-License-Identifier: MIT
13
- *
14
- * This source code is licensed under the MIT license found in the
15
- * LICENSE file in the root directory of this source tree.
16
- */
17
- /* Dimensions */
18
- /* Font sizes */
19
- /* Line heights */
20
- /* Animation timings */
9
+ :host.disabled {
10
+ pointer-events: none;
11
+ }
21
12
  :host .icon-button {
22
13
  padding: 0;
23
14
  overflow: hidden;
24
- }
25
- :host .btn-icon-12 {
26
- height: 1rem;
27
- width: 1rem;
28
- min-width: 1rem;
29
- min-height: 1rem;
30
- }
31
- :host .btn-icon-16 {
32
- height: 1.5rem;
33
- width: 1.5rem;
34
- min-width: 1.5rem;
35
- min-height: 1.5rem;
36
- }
37
- :host .btn-icon-32 {
38
- height: 2rem;
39
- width: 2rem;
40
- min-width: 2rem;
41
- min-height: 2rem;
42
15
  }
@@ -6,7 +6,7 @@
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 { h } from '@stencil/core';
9
+ import { h, Host } from '@stencil/core';
10
10
  import { getButtonClasses } from '../button/base-button';
11
11
  export class IconButton {
12
12
  constructor() {
@@ -26,7 +26,7 @@ export class IconButton {
26
26
  return Object.assign(Object.assign({}, getButtonClasses(this.variant, this.outline, this.ghost || this.invisible, true, this.oval, this.selected, this.disabled)), { 'icon-button': true, 'btn-icon-12': this.size === '12', 'btn-icon-16': this.size === '16', 'btn-icon-32': this.size === '32' || this.size === '24' || !this.size });
27
27
  }
28
28
  render() {
29
- return (h("button", { class: this.getIconButtonClasses(), type: this.type }, h("ix-icon", { size: this.size, name: this.icon, color: this.color }), h("div", { style: { display: 'none' } }, h("slot", null))));
29
+ return (h(Host, { class: { disabled: this.disabled } }, h("button", { class: this.getIconButtonClasses(), type: this.type }, h("ix-icon", { size: this.size, name: this.icon, color: this.color }), h("div", { style: { display: 'none' } }, h("slot", null)))));
30
30
  }
31
31
  static get is() { return "ix-icon-button"; }
32
32
  static get encapsulation() { return "scoped"; }
@@ -107,9 +107,10 @@ export class MapNavigation {
107
107
  overlayInstance.setAttribute('color', color);
108
108
  overlayInstance.setAttribute('name', name);
109
109
  overlayInstance.setAttribute('icon', icon);
110
+ overlayInstance.setAttribute('slot', 'overlay');
110
111
  overlayInstance.addEventListener('closeClick', () => this.closeOverlay());
111
112
  overlayInstance.appendChild(component);
112
- this.overlay.appendChild(overlayInstance);
113
+ this.hostElement.appendChild(overlayInstance);
113
114
  }
114
115
  /**
115
116
  * Close current shown overlay
@@ -134,7 +135,7 @@ export class MapNavigation {
134
135
  });
135
136
  }
136
137
  render() {
137
- return (h(Host, null, h("div", { id: "menu-placeholder" }), h("div", { class: "map-nav" }, h("div", { class: "map-nav-sidebar" }, h("div", { class: "map-nav-header" }, h("ix-application-header", { name: this.applicationName, class: "map-nav-header-brand" }, h("slot", { name: "logo" }))), h("div", { class: "map-nav-sidebar-content" }, h("div", { class: "map-nav-sidebar-static-content" }, h("div", { class: "map-nav-title" }, this.navigationTitle), this.hideContextMenu ? ('') : (h("ix-icon-button", { icon: "context-menu", ghost: true, size: "24", variant: "Secondary", onClick: (_) => this.contextMenuClick.emit() }))), h("div", { class: "map-nav-sidebar-user-content" }, h("slot", { name: "sidebar-content" })))), h("div", { class: "content" }, h("div", { class: "map-nav-header-content bg-2" }, h("slot", { name: "content-header" })), h("main", null, h("slot", null))))));
138
+ return (h(Host, null, h("div", { id: "menu-placeholder" }), h("div", { class: "map-nav" }, h("div", { class: "map-nav-sidebar" }, h("div", { class: "map-nav-header" }, h("ix-application-header", { name: this.applicationName, class: "map-nav-header-brand" }, h("slot", { name: "logo" }))), h("div", { class: "map-nav-sidebar-content" }, h("div", { class: "map-nav-sidebar-static-content" }, h("div", { class: "map-nav-title" }, this.navigationTitle), this.hideContextMenu ? ('') : (h("ix-icon-button", { icon: "context-menu", ghost: true, size: "24", variant: "Secondary", onClick: (_) => this.contextMenuClick.emit() }))), h("div", { class: "map-nav-sidebar-user-content" }, h("slot", { name: "sidebar-content" })))), h("div", { class: "content" }, h("div", { class: "map-nav-header-content bg-2" }, h("slot", { name: "content-header" })), h("main", null, h("slot", null), h("slot", { name: "overlay" }))))));
138
139
  }
139
140
  static get is() { return "ix-map-navigation"; }
140
141
  static get encapsulation() { return "scoped"; }
@@ -192,6 +192,7 @@ a {
192
192
  height: 100%;
193
193
  z-index: 2;
194
194
  top: 0;
195
+ left: 0;
195
196
  background-color: var(--theme-overlay--background);
196
197
  }
197
198
  :host .overlay-header {
@@ -208,7 +209,8 @@ a {
208
209
  min-width: 0;
209
210
  }
210
211
  :host .overlay-header-content ix-icon {
211
- margin-left: 1rem;
212
+ -webkit-margin-start: 1rem;
213
+ margin-inline-start: 1rem;
212
214
  color: var(--theme-overlay-header--color);
213
215
  }
214
216
  :host .overlay-header-content .overlay-header-title {
@@ -223,7 +225,8 @@ a {
223
225
  text-overflow: ellipsis;
224
226
  white-space: nowrap;
225
227
  color: var(--theme-overlay-header--color);
226
- margin-left: 1rem;
228
+ -webkit-margin-start: 1rem;
229
+ margin-inline-start: 1rem;
227
230
  }
228
231
  :host .color-indicator {
229
232
  display: inline-block;
@@ -233,6 +236,8 @@ a {
233
236
  background-color: var(--theme-color-neutral);
234
237
  }
235
238
  :host .overlay-close {
236
- margin-left: auto;
237
- margin-right: 1rem;
239
+ -webkit-margin-start: auto;
240
+ margin-inline-start: auto;
241
+ -webkit-margin-end: 1rem;
242
+ margin-inline-end: 1rem;
238
243
  }
@@ -49,7 +49,7 @@ export class MapNavigationOverlay {
49
49
  'background-color': this.color
50
50
  ? `var(--theme-${this.color})`
51
51
  : '',
52
- } }), h("div", { class: "overlay-header-content" }, h("ix-icon", { size: "32", name: this.icon }), h("span", { class: "overlay-header-title", title: this.name }, this.name)), h("ix-icon-button", { class: "overlay-close", invisible: true, icon: "close", size: "24", onClick: () => this.closeOverlay() })), h("slot", null)));
52
+ } }), h("div", { class: "overlay-header-content" }, h("ix-icon", { size: "32", name: this.icon }), h("span", { class: "overlay-header-title", title: this.name }, this.name)), h("ix-icon-button", { class: "overlay-close", ghost: true, icon: "close", size: "24", onClick: () => this.closeOverlay() })), h("slot", null)));
53
53
  }
54
54
  static get is() { return "ix-map-navigation-overlay"; }
55
55
  static get encapsulation() { return "scoped"; }