@siemens/ix 1.5.0-beta.0 → 1.5.0-beta.1

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 (241) hide show
  1. package/dist/cjs/index-478a4b66.js +8 -0
  2. package/dist/cjs/index.cjs.js +12 -0
  3. package/dist/cjs/index.cjs.js.map +1 -1
  4. package/dist/cjs/ix-blind.cjs.entry.js +6 -3
  5. package/dist/cjs/ix-blind.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ix-breadcrumb_2.cjs.entry.js +1 -1
  7. package/dist/cjs/ix-breadcrumb_2.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ix-category-filter.cjs.entry.js +2 -2
  9. package/dist/cjs/ix-category-filter.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ix-chip.cjs.entry.js +6 -1
  11. package/dist/cjs/ix-chip.cjs.entry.js.map +1 -1
  12. package/dist/cjs/ix-dropdown_2.cjs.entry.js +1 -1
  13. package/dist/cjs/ix-dropdown_2.cjs.entry.js.map +1 -1
  14. package/dist/cjs/ix-filter-chip.cjs.entry.js +2 -2
  15. package/dist/cjs/ix-filter-chip.cjs.entry.js.map +1 -1
  16. package/dist/cjs/ix-flip-tile_2.cjs.entry.js +11 -2
  17. package/dist/cjs/ix-flip-tile_2.cjs.entry.js.map +1 -1
  18. package/dist/cjs/ix-index-button.cjs.entry.js +28 -0
  19. package/dist/cjs/ix-index-button.cjs.entry.js.map +1 -0
  20. package/dist/cjs/ix-input-group.cjs.entry.js +1 -1
  21. package/dist/cjs/ix-input-group.cjs.entry.js.map +1 -1
  22. package/dist/cjs/ix-menu_9.cjs.entry.js +1 -1
  23. package/dist/cjs/ix-menu_9.cjs.entry.js.map +1 -1
  24. package/dist/cjs/ix-pagination.cjs.entry.js +115 -0
  25. package/dist/cjs/ix-pagination.cjs.entry.js.map +1 -0
  26. package/dist/cjs/ix-select_2.cjs.entry.js +3 -3
  27. package/dist/cjs/ix-select_2.cjs.entry.js.map +1 -1
  28. package/dist/cjs/ix-toast_2.cjs.entry.js +10 -1
  29. package/dist/cjs/ix-toast_2.cjs.entry.js.map +1 -1
  30. package/dist/cjs/ix-tooltip.cjs.entry.js +31 -27
  31. package/dist/cjs/ix-tooltip.cjs.entry.js.map +1 -1
  32. package/dist/cjs/ix-tree_2.cjs.entry.js +4 -0
  33. package/dist/cjs/ix-tree_2.cjs.entry.js.map +1 -1
  34. package/dist/cjs/ix-upload.cjs.entry.js +8 -23
  35. package/dist/cjs/ix-upload.cjs.entry.js.map +1 -1
  36. package/dist/cjs/ix-workflow-step_2.cjs.entry.js +1 -1
  37. package/dist/cjs/ix-workflow-step_2.cjs.entry.js.map +1 -1
  38. package/dist/cjs/loader.cjs.js +1 -1
  39. package/dist/cjs/siemens-ix.cjs.js +1 -1
  40. package/dist/cjs/upload-file-state-a79acf2b.js +19 -0
  41. package/dist/cjs/upload-file-state-a79acf2b.js.map +1 -0
  42. package/dist/collection/collection-manifest.json +2 -0
  43. package/dist/collection/components/blind/blind.css +12 -6
  44. package/dist/collection/components/blind/blind.js +25 -2
  45. package/dist/collection/components/blind/blind.js.map +1 -1
  46. package/dist/collection/components/breadcrumb/breadcrumb.css +1 -2
  47. package/dist/collection/components/category-filter/category-filter.js +2 -2
  48. package/dist/collection/components/category-filter/category-filter.js.map +1 -1
  49. package/dist/collection/components/chip/chip.js +27 -2
  50. package/dist/collection/components/chip/chip.js.map +1 -1
  51. package/dist/collection/components/dropdown-item/dropdown-item.js +1 -1
  52. package/dist/collection/components/dropdown-item/dropdown-item.js.map +1 -1
  53. package/dist/collection/components/filter-chip/filter-chip.css +14 -7
  54. package/dist/collection/components/filter-chip/filter-chip.js +1 -1
  55. package/dist/collection/components/filter-chip/filter-chip.js.map +1 -1
  56. package/dist/collection/components/flip-tile/flip-tile.css +0 -4
  57. package/dist/collection/components/flip-tile/flip-tile.js +56 -2
  58. package/dist/collection/components/flip-tile/flip-tile.js.map +1 -1
  59. package/dist/collection/components/index-button/index-button.css +31 -0
  60. package/dist/collection/components/index-button/index-button.js +83 -0
  61. package/dist/collection/components/index-button/index-button.js.map +1 -0
  62. package/dist/collection/components/input-group/input-group.css +3 -0
  63. package/dist/collection/components/menu-item/menu-item.css +15 -10
  64. package/dist/collection/components/pagination/pagination.css +58 -0
  65. package/dist/collection/components/pagination/pagination.js +303 -0
  66. package/dist/collection/components/pagination/pagination.js.map +1 -0
  67. package/dist/collection/components/select/select.js +3 -3
  68. package/dist/collection/components/select/select.js.map +1 -1
  69. package/dist/collection/components/toast/toast-container.js +16 -4
  70. package/dist/collection/components/toast/toast-container.js.map +1 -1
  71. package/dist/collection/components/toast/toast-utils.js +4 -1
  72. package/dist/collection/components/toast/toast-utils.js.map +1 -1
  73. package/dist/collection/components/tooltip/tooltip.css +8 -7
  74. package/dist/collection/components/tooltip/tooltip.js +31 -27
  75. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  76. package/dist/collection/components/tree/tree.js +38 -0
  77. package/dist/collection/components/tree/tree.js.map +1 -1
  78. package/dist/collection/components/workflow-step/workflow-step.css +1 -0
  79. package/dist/collection/index.js +1 -0
  80. package/dist/collection/index.js.map +1 -1
  81. package/dist/components/dropdown-item.js +1 -1
  82. package/dist/components/dropdown-item.js.map +1 -1
  83. package/dist/components/filter-chip.js +2 -2
  84. package/dist/components/filter-chip.js.map +1 -1
  85. package/dist/components/index-button.js +41 -0
  86. package/dist/components/index-button.js.map +1 -0
  87. package/dist/components/index.js +5 -1
  88. package/dist/components/index.js.map +1 -1
  89. package/dist/components/ix-blind.js +15 -5
  90. package/dist/components/ix-blind.js.map +1 -1
  91. package/dist/components/ix-breadcrumb.js +1 -1
  92. package/dist/components/ix-breadcrumb.js.map +1 -1
  93. package/dist/components/ix-category-filter.js +2 -2
  94. package/dist/components/ix-category-filter.js.map +1 -1
  95. package/dist/components/ix-chip.js +6 -1
  96. package/dist/components/ix-chip.js.map +1 -1
  97. package/dist/components/ix-flip-tile.js +13 -2
  98. package/dist/components/ix-flip-tile.js.map +1 -1
  99. package/dist/components/ix-index-button.d.ts +11 -0
  100. package/dist/components/ix-index-button.js +8 -0
  101. package/dist/components/ix-index-button.js.map +1 -0
  102. package/dist/components/ix-input-group.js +1 -1
  103. package/dist/components/ix-input-group.js.map +1 -1
  104. package/dist/components/ix-pagination.d.ts +11 -0
  105. package/dist/components/ix-pagination.js +185 -0
  106. package/dist/components/ix-pagination.js.map +1 -0
  107. package/dist/components/ix-select.js +1 -341
  108. package/dist/components/ix-select.js.map +1 -1
  109. package/dist/components/ix-toast-container.js +10 -1
  110. package/dist/components/ix-toast-container.js.map +1 -1
  111. package/dist/components/ix-tooltip.js +32 -28
  112. package/dist/components/ix-tooltip.js.map +1 -1
  113. package/dist/components/ix-tree.js +4 -0
  114. package/dist/components/ix-tree.js.map +1 -1
  115. package/dist/components/ix-upload.js +1 -16
  116. package/dist/components/ix-upload.js.map +1 -1
  117. package/dist/components/ix-workflow-step.js +1 -1
  118. package/dist/components/ix-workflow-step.js.map +1 -1
  119. package/dist/components/menu-item.js +1 -1
  120. package/dist/components/menu-item.js.map +1 -1
  121. package/dist/components/select.js +345 -0
  122. package/dist/components/select.js.map +1 -0
  123. package/dist/components/upload-file-state.js +19 -0
  124. package/dist/components/upload-file-state.js.map +1 -0
  125. package/dist/esm/index-3d163acd.js +8 -0
  126. package/dist/esm/index.js +5 -1
  127. package/dist/esm/index.js.map +1 -1
  128. package/dist/esm/ix-blind.entry.js +6 -3
  129. package/dist/esm/ix-blind.entry.js.map +1 -1
  130. package/dist/esm/ix-breadcrumb_2.entry.js +1 -1
  131. package/dist/esm/ix-breadcrumb_2.entry.js.map +1 -1
  132. package/dist/esm/ix-category-filter.entry.js +2 -2
  133. package/dist/esm/ix-category-filter.entry.js.map +1 -1
  134. package/dist/esm/ix-chip.entry.js +6 -1
  135. package/dist/esm/ix-chip.entry.js.map +1 -1
  136. package/dist/esm/ix-dropdown_2.entry.js +1 -1
  137. package/dist/esm/ix-dropdown_2.entry.js.map +1 -1
  138. package/dist/esm/ix-filter-chip.entry.js +2 -2
  139. package/dist/esm/ix-filter-chip.entry.js.map +1 -1
  140. package/dist/esm/ix-flip-tile_2.entry.js +11 -2
  141. package/dist/esm/ix-flip-tile_2.entry.js.map +1 -1
  142. package/dist/esm/ix-index-button.entry.js +24 -0
  143. package/dist/esm/ix-index-button.entry.js.map +1 -0
  144. package/dist/esm/ix-input-group.entry.js +1 -1
  145. package/dist/esm/ix-input-group.entry.js.map +1 -1
  146. package/dist/esm/ix-menu_9.entry.js +1 -1
  147. package/dist/esm/ix-menu_9.entry.js.map +1 -1
  148. package/dist/esm/ix-pagination.entry.js +111 -0
  149. package/dist/esm/ix-pagination.entry.js.map +1 -0
  150. package/dist/esm/ix-select_2.entry.js +3 -3
  151. package/dist/esm/ix-select_2.entry.js.map +1 -1
  152. package/dist/esm/ix-toast_2.entry.js +10 -1
  153. package/dist/esm/ix-toast_2.entry.js.map +1 -1
  154. package/dist/esm/ix-tooltip.entry.js +32 -28
  155. package/dist/esm/ix-tooltip.entry.js.map +1 -1
  156. package/dist/esm/ix-tree_2.entry.js +4 -0
  157. package/dist/esm/ix-tree_2.entry.js.map +1 -1
  158. package/dist/esm/ix-upload.entry.js +1 -16
  159. package/dist/esm/ix-upload.entry.js.map +1 -1
  160. package/dist/esm/ix-workflow-step_2.entry.js +1 -1
  161. package/dist/esm/ix-workflow-step_2.entry.js.map +1 -1
  162. package/dist/esm/loader.js +1 -1
  163. package/dist/esm/siemens-ix.js +1 -1
  164. package/dist/esm/upload-file-state-532a36d3.js +19 -0
  165. package/dist/esm/upload-file-state-532a36d3.js.map +1 -0
  166. package/dist/siemens-ix/index.esm.js +1 -1
  167. package/dist/siemens-ix/index.esm.js.map +1 -1
  168. package/dist/siemens-ix/p-030078b4.entry.js +2 -0
  169. package/dist/siemens-ix/p-030078b4.entry.js.map +1 -0
  170. package/dist/siemens-ix/p-076c29d1.js +2 -0
  171. package/dist/siemens-ix/p-076c29d1.js.map +1 -0
  172. package/dist/siemens-ix/p-0f864265.entry.js +2 -0
  173. package/dist/siemens-ix/p-0f864265.entry.js.map +1 -0
  174. package/dist/siemens-ix/p-16ec6f50.entry.js +2 -0
  175. package/dist/siemens-ix/p-16ec6f50.entry.js.map +1 -0
  176. package/dist/siemens-ix/p-1701b127.entry.js +2 -0
  177. package/dist/siemens-ix/p-1701b127.entry.js.map +1 -0
  178. package/dist/siemens-ix/p-24d2d95e.entry.js +2 -0
  179. package/dist/siemens-ix/p-24d2d95e.entry.js.map +1 -0
  180. package/dist/siemens-ix/{p-11af475f.entry.js → p-28f50519.entry.js} +2 -2
  181. package/dist/siemens-ix/p-28f50519.entry.js.map +1 -0
  182. package/dist/siemens-ix/{p-6790d123.entry.js → p-34e3a10e.entry.js} +2 -2
  183. package/dist/siemens-ix/{p-6790d123.entry.js.map → p-34e3a10e.entry.js.map} +1 -1
  184. package/dist/siemens-ix/p-446a0a3f.entry.js +2 -0
  185. package/dist/siemens-ix/p-446a0a3f.entry.js.map +1 -0
  186. package/dist/siemens-ix/p-55d0fabf.entry.js +2 -0
  187. package/dist/siemens-ix/p-55d0fabf.entry.js.map +1 -0
  188. package/dist/siemens-ix/{p-9f55716d.entry.js → p-58ef1328.entry.js} +2 -2
  189. package/dist/siemens-ix/p-58ef1328.entry.js.map +1 -0
  190. package/dist/siemens-ix/{p-aafd18a8.entry.js → p-62b4d696.entry.js} +2 -2
  191. package/dist/siemens-ix/p-62b4d696.entry.js.map +1 -0
  192. package/dist/siemens-ix/p-6facc3cc.entry.js +2 -0
  193. package/dist/siemens-ix/p-6facc3cc.entry.js.map +1 -0
  194. package/dist/siemens-ix/p-73f7ef87.entry.js +2 -0
  195. package/dist/siemens-ix/p-73f7ef87.entry.js.map +1 -0
  196. package/dist/siemens-ix/{p-1811d669.entry.js → p-88a47c9b.entry.js} +2 -2
  197. package/dist/siemens-ix/p-88a47c9b.entry.js.map +1 -0
  198. package/dist/siemens-ix/p-9546cbdd.entry.js +2 -0
  199. package/dist/siemens-ix/p-9546cbdd.entry.js.map +1 -0
  200. package/dist/siemens-ix/{p-5ce07b8b.entry.js → p-afd1f351.entry.js} +2 -2
  201. package/dist/siemens-ix/p-afd1f351.entry.js.map +1 -0
  202. package/dist/siemens-ix/p-b9fbd029.entry.js +2 -0
  203. package/dist/siemens-ix/p-b9fbd029.entry.js.map +1 -0
  204. package/dist/siemens-ix/siemens-ix.css +6 -0
  205. package/dist/siemens-ix/siemens-ix.esm.js +1 -1
  206. package/dist/siemens-ix/siemens-ix.esm.js.map +1 -1
  207. package/dist/types/components/blind/blind.d.ts +5 -0
  208. package/dist/types/components/chip/chip.d.ts +8 -0
  209. package/dist/types/components/flip-tile/flip-tile.d.ts +11 -0
  210. package/dist/types/components/index-button/index-button.d.ts +16 -0
  211. package/dist/types/components/pagination/pagination.d.ts +55 -0
  212. package/dist/types/components/toast/toast-container.d.ts +3 -1
  213. package/dist/types/components/toast/toast-utils.d.ts +3 -0
  214. package/dist/types/components/tree/tree.d.ts +13 -0
  215. package/dist/types/components.d.ts +182 -2
  216. package/dist/types/index.d.ts +1 -0
  217. package/package.json +3 -2
  218. package/scss/components/_forms.scss +1 -1
  219. package/dist/siemens-ix/p-0d15aa1a.entry.js +0 -2
  220. package/dist/siemens-ix/p-0d15aa1a.entry.js.map +0 -1
  221. package/dist/siemens-ix/p-11af475f.entry.js.map +0 -1
  222. package/dist/siemens-ix/p-1259ea24.entry.js +0 -2
  223. package/dist/siemens-ix/p-1259ea24.entry.js.map +0 -1
  224. package/dist/siemens-ix/p-1811d669.entry.js.map +0 -1
  225. package/dist/siemens-ix/p-29bd1814.entry.js +0 -2
  226. package/dist/siemens-ix/p-29bd1814.entry.js.map +0 -1
  227. package/dist/siemens-ix/p-5845a03c.entry.js +0 -2
  228. package/dist/siemens-ix/p-5845a03c.entry.js.map +0 -1
  229. package/dist/siemens-ix/p-5ce07b8b.entry.js.map +0 -1
  230. package/dist/siemens-ix/p-7ce0c0e2.entry.js +0 -2
  231. package/dist/siemens-ix/p-7ce0c0e2.entry.js.map +0 -1
  232. package/dist/siemens-ix/p-967f7d5d.entry.js +0 -2
  233. package/dist/siemens-ix/p-967f7d5d.entry.js.map +0 -1
  234. package/dist/siemens-ix/p-9f55716d.entry.js.map +0 -1
  235. package/dist/siemens-ix/p-aafd18a8.entry.js.map +0 -1
  236. package/dist/siemens-ix/p-d7def96c.entry.js +0 -2
  237. package/dist/siemens-ix/p-d7def96c.entry.js.map +0 -1
  238. package/dist/siemens-ix/p-f961c22a.entry.js +0 -2
  239. package/dist/siemens-ix/p-f961c22a.entry.js.map +0 -1
  240. package/dist/siemens-ix/p-fe690347.entry.js +0 -2
  241. package/dist/siemens-ix/p-fe690347.entry.js.map +0 -1
@@ -0,0 +1,303 @@
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.5.0
12
+ */
13
+ export class Pagination {
14
+ constructor() {
15
+ this.maxCountPages = 7;
16
+ this.advanced = undefined;
17
+ this.itemCount = 15;
18
+ this.showItemCount = true;
19
+ this.count = undefined;
20
+ this.selectedPage = 0;
21
+ this.i18nPage = 'Page';
22
+ this.i18nOf = 'of';
23
+ this.i18nItems = 'Items';
24
+ }
25
+ selectPage(index) {
26
+ if (index < 0 || index >= this.count) {
27
+ console.warn(`ix-pagination - invalid index ${index}`);
28
+ return;
29
+ }
30
+ this.selectedPage = index;
31
+ this.pageSelected.emit(index);
32
+ }
33
+ increase() {
34
+ if (this.selectedPage === this.count - 1) {
35
+ return;
36
+ }
37
+ this.selectPage(this.selectedPage + 1);
38
+ }
39
+ decrease() {
40
+ if (this.selectedPage === 0) {
41
+ return;
42
+ }
43
+ this.selectPage(this.selectedPage - 1);
44
+ }
45
+ getPageButton(index) {
46
+ return (h("ix-index-button", { variant: "Primary", onClick: () => {
47
+ this.selectPage(index);
48
+ }, selected: this.selectedPage === index }, index + 1));
49
+ }
50
+ renderPageButtons() {
51
+ const pagesBeforeOverflow = Math.floor(this.maxCountPages / 2);
52
+ const hasOverflow = this.count > this.maxCountPages;
53
+ const hasOverflowStart = hasOverflow && this.selectedPage > pagesBeforeOverflow;
54
+ const hasOverflowEnd = hasOverflow && this.selectedPage < this.count - pagesBeforeOverflow - 1;
55
+ const pageButtons = [];
56
+ let start = 0;
57
+ let end = Math.min(this.count, this.maxCountPages);
58
+ let pageCount = Math.floor((this.maxCountPages - 4) / 2);
59
+ if (hasOverflowStart) {
60
+ pageButtons.push(this.getPageButton(0));
61
+ pageButtons.push(h("ix-index-button", { variant: "Secondary", onClick: () => {
62
+ if (hasOverflowEnd) {
63
+ this.selectPage(this.selectedPage - Math.max(0, 2 * pageCount + 1));
64
+ }
65
+ else {
66
+ this.selectPage(this.count - this.maxCountPages);
67
+ }
68
+ } }, "..."));
69
+ if (hasOverflowEnd) {
70
+ start = this.count - this.maxCountPages + 2;
71
+ }
72
+ else {
73
+ start = this.count - this.maxCountPages + 2;
74
+ end = this.count;
75
+ }
76
+ }
77
+ if (hasOverflowEnd) {
78
+ if (hasOverflowStart) {
79
+ start = this.selectedPage - pageCount;
80
+ end = this.selectedPage + pageCount + 1;
81
+ }
82
+ else {
83
+ end = this.maxCountPages - 2;
84
+ }
85
+ }
86
+ for (let i = start; i < end; i++) {
87
+ pageButtons.push(this.getPageButton(i));
88
+ }
89
+ if (hasOverflowEnd) {
90
+ pageButtons.push(h("ix-index-button", { variant: "Secondary", onClick: () => {
91
+ if (hasOverflowStart) {
92
+ this.selectPage(this.selectedPage + Math.max(0, 2 * pageCount + 1));
93
+ }
94
+ else {
95
+ this.selectPage(this.maxCountPages - 1);
96
+ }
97
+ } }, "..."));
98
+ pageButtons.push(this.getPageButton(this.count - 1));
99
+ }
100
+ return h("span", { class: "page-buttons" }, pageButtons);
101
+ }
102
+ render() {
103
+ return (h(Host, null, h("ix-icon-button", { disabled: this.selectedPage === 0, ghost: true, icon: "chevron-left-small", onClick: () => this.decrease() }), this.advanced ? (h("div", { class: "advanced-pagination" }, this.i18nPage, h("input", { class: "form-control", type: "number", value: this.selectedPage, onChange: (e) => {
104
+ const index = Number.parseInt(e.target['value']);
105
+ this.selectPage(index);
106
+ } }), h("span", { class: "total-count" }, this.i18nOf, " ", this.count))) : (h("span", { class: "basic-pagination" }, this.renderPageButtons(), " ")), h("ix-icon-button", { disabled: this.selectedPage === this.count - 1, ghost: true, icon: "chevron-right-small", onClick: () => this.increase() }), this.advanced && this.showItemCount ? (h("span", { class: "item-count" }, this.i18nItems, h("ix-select", { i18nPlaceholder: "", i18nSelectListHeader: "", "selected-indices": this.itemCount, onItemSelectionChange: (e) => {
107
+ const count = Number.parseInt(e.detail[0]);
108
+ this.itemCountChanged.emit(count);
109
+ } }, h("ix-select-item", { label: "10", value: "10" }), h("ix-select-item", { label: "15", value: "15" }), h("ix-select-item", { label: "20", value: "20" }), h("ix-select-item", { label: "40", value: "40" }), h("ix-select-item", { label: "100", value: "100" })))) : ('')));
110
+ }
111
+ static get is() { return "ix-pagination"; }
112
+ static get encapsulation() { return "scoped"; }
113
+ static get originalStyleUrls() {
114
+ return {
115
+ "$": ["pagination.scss"]
116
+ };
117
+ }
118
+ static get styleUrls() {
119
+ return {
120
+ "$": ["pagination.css"]
121
+ };
122
+ }
123
+ static get properties() {
124
+ return {
125
+ "advanced": {
126
+ "type": "boolean",
127
+ "mutable": false,
128
+ "complexType": {
129
+ "original": "boolean",
130
+ "resolved": "boolean",
131
+ "references": {}
132
+ },
133
+ "required": false,
134
+ "optional": false,
135
+ "docs": {
136
+ "tags": [],
137
+ "text": "Advanced mode"
138
+ },
139
+ "attribute": "advanced",
140
+ "reflect": false
141
+ },
142
+ "itemCount": {
143
+ "type": "number",
144
+ "mutable": false,
145
+ "complexType": {
146
+ "original": "number",
147
+ "resolved": "number",
148
+ "references": {}
149
+ },
150
+ "required": false,
151
+ "optional": false,
152
+ "docs": {
153
+ "tags": [],
154
+ "text": "Number of items shown at once.\nCan only be changed in advaced mode."
155
+ },
156
+ "attribute": "item-count",
157
+ "reflect": false,
158
+ "defaultValue": "15"
159
+ },
160
+ "showItemCount": {
161
+ "type": "boolean",
162
+ "mutable": false,
163
+ "complexType": {
164
+ "original": "boolean",
165
+ "resolved": "boolean",
166
+ "references": {}
167
+ },
168
+ "required": false,
169
+ "optional": false,
170
+ "docs": {
171
+ "tags": [],
172
+ "text": "Show item count in advanced mode"
173
+ },
174
+ "attribute": "show-item-count",
175
+ "reflect": false,
176
+ "defaultValue": "true"
177
+ },
178
+ "count": {
179
+ "type": "number",
180
+ "mutable": false,
181
+ "complexType": {
182
+ "original": "number",
183
+ "resolved": "number",
184
+ "references": {}
185
+ },
186
+ "required": false,
187
+ "optional": false,
188
+ "docs": {
189
+ "tags": [],
190
+ "text": "Total number of pages"
191
+ },
192
+ "attribute": "count",
193
+ "reflect": false
194
+ },
195
+ "selectedPage": {
196
+ "type": "number",
197
+ "mutable": true,
198
+ "complexType": {
199
+ "original": "number",
200
+ "resolved": "number",
201
+ "references": {}
202
+ },
203
+ "required": false,
204
+ "optional": false,
205
+ "docs": {
206
+ "tags": [],
207
+ "text": "Zero based index of currently selected page"
208
+ },
209
+ "attribute": "selected-page",
210
+ "reflect": false,
211
+ "defaultValue": "0"
212
+ },
213
+ "i18nPage": {
214
+ "type": "string",
215
+ "mutable": false,
216
+ "complexType": {
217
+ "original": "string",
218
+ "resolved": "string",
219
+ "references": {}
220
+ },
221
+ "required": false,
222
+ "optional": false,
223
+ "docs": {
224
+ "tags": [],
225
+ "text": "i18n"
226
+ },
227
+ "attribute": "i-1-8n-page",
228
+ "reflect": false,
229
+ "defaultValue": "'Page'"
230
+ },
231
+ "i18nOf": {
232
+ "type": "string",
233
+ "mutable": false,
234
+ "complexType": {
235
+ "original": "string",
236
+ "resolved": "string",
237
+ "references": {}
238
+ },
239
+ "required": false,
240
+ "optional": false,
241
+ "docs": {
242
+ "tags": [],
243
+ "text": "i18n"
244
+ },
245
+ "attribute": "i-1-8n-of",
246
+ "reflect": false,
247
+ "defaultValue": "'of'"
248
+ },
249
+ "i18nItems": {
250
+ "type": "string",
251
+ "mutable": false,
252
+ "complexType": {
253
+ "original": "string",
254
+ "resolved": "string",
255
+ "references": {}
256
+ },
257
+ "required": false,
258
+ "optional": false,
259
+ "docs": {
260
+ "tags": [],
261
+ "text": "/**\n i18n"
262
+ },
263
+ "attribute": "i-1-8n-items",
264
+ "reflect": false,
265
+ "defaultValue": "'Items'"
266
+ }
267
+ };
268
+ }
269
+ static get events() {
270
+ return [{
271
+ "method": "pageSelected",
272
+ "name": "pageSelected",
273
+ "bubbles": true,
274
+ "cancelable": true,
275
+ "composed": true,
276
+ "docs": {
277
+ "tags": [],
278
+ "text": "Page selection event"
279
+ },
280
+ "complexType": {
281
+ "original": "number",
282
+ "resolved": "number",
283
+ "references": {}
284
+ }
285
+ }, {
286
+ "method": "itemCountChanged",
287
+ "name": "itemCountChanged",
288
+ "bubbles": true,
289
+ "cancelable": true,
290
+ "composed": true,
291
+ "docs": {
292
+ "tags": [],
293
+ "text": "Item count change event"
294
+ },
295
+ "complexType": {
296
+ "original": "number",
297
+ "resolved": "number",
298
+ "references": {}
299
+ }
300
+ }];
301
+ }
302
+ }
303
+ //# sourceMappingURL=pagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/components/pagination/pagination.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE9E;;GAEG;AAMH,MAAM,OAAO,UAAU;;IACJ,kBAAa,GAAG,CAAC,CAAC;;qBAWf,EAAE;yBAKE,IAAI;;wBAUY,CAAC;oBAKtB,MAAM;kBAKR,IAAI;qBAMD,OAAO;;EAYnB,UAAU,CAA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C,KAAK,GAAkB,CAC/C,CACP,CACR,CAAC,CAAC,CAAC,CACF,EAAE,CACH,CACI,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2022 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { Component, Event, EventEmitter, h, Host, Prop } from '@stencil/core';\n\n/**\n * @since 1.5.0\n */\n@Component({\n tag: 'ix-pagination',\n styleUrl: 'pagination.scss',\n scoped: true,\n})\nexport class Pagination {\n private readonly maxCountPages = 7;\n\n /**\n * Advanced mode\n */\n @Prop() advanced: boolean;\n\n /**\n * Number of items shown at once.\n * Can only be changed in advaced mode.\n */\n @Prop() itemCount = 15;\n\n /**\n * Show item count in advanced mode\n */\n @Prop() showItemCount = true;\n\n /**\n * Total number of pages\n */\n @Prop() count: number;\n\n /**\n * Zero based index of currently selected page\n */\n @Prop({ mutable: true }) selectedPage = 0;\n\n /**\n * i18n\n */\n @Prop() i18nPage = 'Page';\n\n /**\n * i18n\n */\n @Prop() i18nOf = 'of';\n\n /**\n /**\n * i18n\n */\n @Prop() i18nItems = 'Items';\n\n /**\n * Page selection event\n */\n @Event() pageSelected: EventEmitter<number>;\n\n /**\n * Item count change event\n */\n @Event() itemCountChanged: EventEmitter<number>;\n\n private selectPage(index: number) {\n if (index < 0 || index >= this.count) {\n console.warn(`ix-pagination - invalid index ${index}`);\n return;\n }\n\n this.selectedPage = index;\n this.pageSelected.emit(index);\n }\n\n private increase() {\n if (this.selectedPage === this.count - 1) {\n return;\n }\n\n this.selectPage(this.selectedPage + 1);\n }\n\n private decrease() {\n if (this.selectedPage === 0) {\n return;\n }\n\n this.selectPage(this.selectedPage - 1);\n }\n\n private getPageButton(index: number) {\n return (\n <ix-index-button\n variant=\"Primary\"\n onClick={() => {\n this.selectPage(index);\n }}\n selected={this.selectedPage === index}\n >\n {index + 1}\n </ix-index-button>\n );\n }\n\n private renderPageButtons() {\n const pagesBeforeOverflow = Math.floor(this.maxCountPages / 2);\n const hasOverflow = this.count > this.maxCountPages;\n const hasOverflowStart =\n hasOverflow && this.selectedPage > pagesBeforeOverflow;\n const hasOverflowEnd =\n hasOverflow && this.selectedPage < this.count - pagesBeforeOverflow - 1;\n const pageButtons = [];\n\n let start = 0;\n let end = Math.min(this.count, this.maxCountPages);\n let pageCount = Math.floor((this.maxCountPages - 4) / 2);\n\n if (hasOverflowStart) {\n pageButtons.push(this.getPageButton(0));\n pageButtons.push(\n <ix-index-button\n variant=\"Secondary\"\n onClick={() => {\n if (hasOverflowEnd) {\n this.selectPage(\n this.selectedPage - Math.max(0, 2 * pageCount + 1)\n );\n } else {\n this.selectPage(this.count - this.maxCountPages);\n }\n }}\n >\n ...\n </ix-index-button>\n );\n\n if (hasOverflowEnd) {\n start = this.count - this.maxCountPages + 2;\n } else {\n start = this.count - this.maxCountPages + 2;\n end = this.count;\n }\n }\n\n if (hasOverflowEnd) {\n if (hasOverflowStart) {\n start = this.selectedPage - pageCount;\n end = this.selectedPage + pageCount + 1;\n } else {\n end = this.maxCountPages - 2;\n }\n }\n\n for (let i = start; i < end; i++) {\n pageButtons.push(this.getPageButton(i));\n }\n\n if (hasOverflowEnd) {\n pageButtons.push(\n <ix-index-button\n variant=\"Secondary\"\n onClick={() => {\n if (hasOverflowStart) {\n this.selectPage(\n this.selectedPage + Math.max(0, 2 * pageCount + 1)\n );\n } else {\n this.selectPage(this.maxCountPages - 1);\n }\n }}\n >\n ...\n </ix-index-button>\n );\n pageButtons.push(this.getPageButton(this.count - 1));\n }\n\n return <span class=\"page-buttons\">{pageButtons}</span>;\n }\n\n render() {\n return (\n <Host>\n <ix-icon-button\n disabled={this.selectedPage === 0}\n ghost\n icon=\"chevron-left-small\"\n onClick={() => this.decrease()}\n ></ix-icon-button>\n\n {this.advanced ? (\n <div class=\"advanced-pagination\">\n {this.i18nPage}\n <input\n class=\"form-control\"\n type=\"number\"\n value={this.selectedPage}\n onChange={(e) => {\n const index = Number.parseInt(e.target['value']);\n this.selectPage(index);\n }}\n />\n <span class=\"total-count\">\n {this.i18nOf} {this.count}\n </span>\n </div>\n ) : (\n <span class=\"basic-pagination\">{this.renderPageButtons()} </span>\n )}\n\n <ix-icon-button\n disabled={this.selectedPage === this.count - 1}\n ghost\n icon=\"chevron-right-small\"\n onClick={() => this.increase()}\n ></ix-icon-button>\n\n {this.advanced && this.showItemCount ? (\n <span class=\"item-count\">\n {this.i18nItems}\n <ix-select\n i18nPlaceholder=\"\"\n i18nSelectListHeader=\"\"\n selected-indices={this.itemCount}\n onItemSelectionChange={(e) => {\n const count = Number.parseInt(e.detail[0]);\n this.itemCountChanged.emit(count);\n }}\n >\n <ix-select-item label=\"10\" value=\"10\"></ix-select-item>\n <ix-select-item label=\"15\" value=\"15\"></ix-select-item>\n <ix-select-item label=\"20\" value=\"20\"></ix-select-item>\n <ix-select-item label=\"40\" value=\"40\"></ix-select-item>\n <ix-select-item label=\"100\" value=\"100\"></ix-select-item>\n </ix-select>\n </span>\n ) : (\n ''\n )}\n </Host>\n );\n }\n}\n"]}
@@ -230,7 +230,7 @@ export class Select {
230
230
  if (!this.editable)
231
231
  this.dropdownWrapperRef = ref;
232
232
  } }, h("div", { class: "input-container" }, h("div", { class: "chips" }, this.isMultipleMode
233
- ? (_a = this.selectedItems) === null || _a === void 0 ? void 0 : _a.map((item) => (h("ix-filter-chip", { disabled: this.disabled || this.readonly, onCloseClick: (e) => {
233
+ ? (_a = this.selectedItems) === null || _a === void 0 ? void 0 : _a.map((item) => (h("ix-filter-chip", { disabled: this.disabled || this.readonly, key: item.value, onCloseClick: (e) => {
234
234
  e.preventDefault();
235
235
  e.stopPropagation();
236
236
  this.emitItemClick(item.value);
@@ -252,9 +252,9 @@ export class Select {
252
252
  'd-none': this.disabled ||
253
253
  this.readonly ||
254
254
  (this.isDropdownEmpty && !this.editable),
255
- }, anchor: this.dropdownAnchor, trigger: this.dropdownWrapperRef, onShowChanged: (e) => this.dropdownVisibilityChanged(e), placement: "auto-start", overwriteDropdownStyle: async (delegateConfig) => {
255
+ }, anchor: this.dropdownAnchor, trigger: this.dropdownWrapperRef, onShowChanged: (e) => this.dropdownVisibilityChanged(e), placement: "auto-start", overwriteDropdownStyle: async () => {
256
256
  return {
257
- width: `${delegateConfig.triggerRef.clientWidth}px`,
257
+ width: `${this.hostElement.clientWidth}px`,
258
258
  };
259
259
  } }, 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: {
260
260
  'add-item': true,
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACN,MAAM,eAAe,CAAC;AAQvB,MAAM,OAAO,MAAM;;2BAM6C,EAAE;sBAK3C,KAAK;gBAKY,QAAQ;oBAK3B,KAAK;oBAKL,KAAK;oBAKL,KAAK;2BAKE,kBAAkB;mCAKV,uBAAuB;gCAK1B,yBAAyB;wBAYhC,KAAK;;;;2BAIF,KAAK;oBACZ,KAAK;;;;;EAWzB,IAAI,KAAK;IACP,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { IxSelectItemLabelChangeEvent } from '../select-item/events';\n\n@Component({\n tag: 'ix-select',\n styleUrl: 'select.scss',\n scoped: true,\n})\nexport class Select {\n @Element() hostElement!: HTMLIxSelectElement;\n\n /**\n * Indices of selected items\n */\n @Prop({ mutable: true }) selectedIndices: string | string[] = [];\n\n /**\n * Show clear button\n */\n @Prop() allowClear = false;\n\n /**\n * Selection mode\n */\n @Prop() mode: 'single' | 'multiple' = 'single';\n\n /**\n * Select is extendable\n */\n @Prop() editable = false;\n\n /**\n * If true the select will be in disabled state\n */\n @Prop() disabled = false;\n\n /**\n * If true the select will be in readonly mode\n */\n @Prop() readonly = false;\n\n /**\n * Input field placeholder\n */\n @Prop() i18nPlaceholder = 'Select an option';\n\n /**\n * Input field placeholder for editable select\n */\n @Prop() i18nPlaceholderEditable = 'Type of select option';\n\n /**\n * Select list header\n */\n @Prop() i18nSelectListHeader = 'Please select an option';\n\n /**\n * Item selection changed\n */\n @Event() itemSelectionChange: EventEmitter<string | string[]>;\n\n /**\n * Item added to selection\n */\n @Event() addItem: EventEmitter<string>;\n\n @State() dropdownShow = false;\n @State() value: string[];\n @State() dropdownWrapperRef!: HTMLElement;\n @State() dropdownAnchor!: HTMLElement;\n @State() isDropdownEmpty = false;\n @State() hasFocus = false;\n @State() navigationItem: HTMLIxSelectItemElement;\n @State() inputFilterText: string;\n @State() inputValue: string;\n\n private inputRef!: HTMLInputElement;\n private dropdownRef!: HTMLIxDropdownElement;\n private addItemRef!: HTMLDivElement;\n\n private labelMutationObserver: MutationObserver;\n\n get items() {\n return Array.from(this.hostElement.querySelectorAll('ix-select-item'));\n }\n\n get selectedItems() {\n return this.items.filter((item) => item.selected);\n }\n\n get addItemButton() {\n return this.hostElement.querySelector('.add-item');\n }\n\n get isSingleMode() {\n return this.mode === 'single';\n }\n\n get isMultipleMode() {\n return this.mode === 'multiple';\n }\n\n @Watch('selectedIndices')\n watchSelectedIndices(newId: string | string[]) {\n if (!newId) {\n this.selectValue([]);\n return;\n }\n\n if (Array.isArray(newId)) {\n this.selectValue([...newId]);\n return;\n }\n\n this.selectValue([newId]);\n }\n\n @Listen('itemClick')\n onItemClicked(event: CustomEvent<string>) {\n const newId = event.detail;\n this.emitItemClick(newId);\n }\n\n @Watch('inputFilterText')\n watchInputText(newValue: string) {\n if (!this.editable) {\n return;\n }\n\n if (this.itemExists(newValue)) {\n return;\n }\n }\n\n private emitItemClick(newId: string) {\n if (this.isMultipleMode && Array.isArray(this.selectedIndices)) {\n if (this.selectedIndices.includes(newId)) {\n this.selectedIndices = this.selectedIndices.filter((i) => i !== newId);\n } else {\n this.selectedIndices = [...this.selectedIndices, newId];\n }\n } else {\n this.selectedIndices = [newId];\n }\n\n this.selectValue(this.selectedIndices);\n this.itemSelectionChange.emit(this.selectedIndices);\n }\n\n private emitAddItem(value: string) {\n if (value.trim() === '') {\n return;\n }\n\n const test = document.createElement('ix-select-item');\n test.value = value;\n test.label = value;\n\n this.addItemRef.appendChild(test);\n\n this.clearInput();\n this.emitItemClick(value);\n this.addItem.emit(value);\n }\n\n private selectValue(ids: string[]) {\n this.items.forEach((item) => {\n item.selected = ids.some((i) => i === item.value);\n });\n\n this.value = this.selectedItems.map((item) => item.label);\n\n if (this.isSingleMode) {\n this.inputValue = this.value?.length ? this.value[0] : null;\n return;\n }\n\n this.inputValue = null;\n }\n\n componentWillLoad() {\n if (this.selectedIndices) {\n this.selectValue(\n Array.isArray(this.selectedIndices)\n ? this.selectedIndices\n : [this.selectedIndices]\n );\n }\n }\n\n @Listen('ix-select-item:labelChange')\n onLabelChange(event: IxSelectItemLabelChangeEvent) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.selectValue(\n Array.isArray(this.selectedIndices)\n ? this.selectedIndices\n : [this.selectedIndices]\n );\n }\n\n disconnectedCallback() {\n if (this.labelMutationObserver) {\n this.labelMutationObserver.disconnect();\n }\n }\n\n private itemExists(item: string) {\n return this.items.find((i) => i.label === item);\n }\n\n private dropdownVisibilityChanged(event: CustomEvent<boolean>) {\n this.dropdownShow = event.detail;\n\n if (event.detail) {\n this.inputRef.focus();\n this.inputRef.select();\n\n this.navigationItem = this.items[0];\n this.setHoverEffectForNavigatedSelectItem();\n this.removeHiddenFromItems();\n }\n this.hasFocus = event.detail;\n }\n\n @Listen('keydown', {\n target: 'window',\n })\n async onKeyDown(event: KeyboardEvent) {\n if (!this.dropdownShow) {\n return;\n }\n\n if (event.code === 'ArrowDown' || event.code === 'ArrowUp') {\n this.onArrowNavigation(event);\n }\n\n if (event.code === 'Enter' || event.code === 'NumpadEnter') {\n await this.onEnterNavigation();\n }\n\n if (event.code === 'Escape') {\n this.dropdownShow = false;\n }\n }\n\n private async onEnterNavigation() {\n if (this.isMultipleMode) {\n return;\n }\n\n if (this.editable && !this.itemExists(this.inputFilterText)) {\n this.emitAddItem(this.inputFilterText);\n this.navigationItem = this.items[this.items.length - 1];\n }\n\n this.navigationItem?.onItemClick();\n await this.dropdownRef?.updatePosition();\n\n if (this.isSingleMode && !this.editable) {\n this.dropdownShow = false;\n }\n }\n\n private onArrowNavigation(event: KeyboardEvent) {\n event.stopPropagation();\n event.preventDefault();\n\n const selectItems = this.items.filter(\n (i) => !i.classList.contains('d-none')\n );\n\n const index = selectItems.indexOf(this.navigationItem);\n\n if (event.code === 'ArrowDown' && index < selectItems.length - 1) {\n this.navigationItem = selectItems[index + 1];\n } else if (event.code === 'ArrowUp' && index > 0) {\n this.navigationItem = selectItems[index - 1];\n }\n\n this.setHoverEffectForNavigatedSelectItem();\n }\n\n private setHoverEffectForNavigatedSelectItem() {\n this.items.forEach((item: HTMLIxSelectItemElement) => {\n item.hover = item === this.navigationItem;\n });\n }\n\n private filterItemsWithTypeahead() {\n this.inputFilterText = this.inputRef.value;\n if (this.inputFilterText) {\n this.items.forEach((item) => {\n item.classList.remove('d-none');\n if (\n !item.label.toLowerCase().includes(this.inputFilterText.toLowerCase())\n ) {\n item.classList.add('d-none');\n }\n });\n } else {\n this.removeHiddenFromItems();\n }\n this.isDropdownEmpty = this.items.every((item) =>\n item.classList.contains('d-none')\n );\n }\n\n private removeHiddenFromItems() {\n this.items.forEach((item) => {\n item.classList.remove('d-none');\n });\n }\n\n private clearInput() {\n this.inputRef.value = '';\n this.inputFilterText = '';\n }\n\n private clear() {\n this.clearInput();\n this.value = [];\n this.selectedIndices = [];\n this.itemSelectionChange.emit(null);\n this.dropdownShow = false;\n }\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'form-control': true,\n select: true,\n focus: this.hasFocus,\n editable: this.editable,\n disabled: this.disabled,\n readonly: this.readonly,\n }}\n ref={(ref) => {\n this.dropdownAnchor = ref;\n if (!this.editable) this.dropdownWrapperRef = ref;\n }}\n >\n <div class=\"input-container\">\n <div class=\"chips\">\n {this.isMultipleMode\n ? this.selectedItems?.map((item) => (\n <ix-filter-chip\n disabled={this.disabled || this.readonly}\n onCloseClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n this.emitItemClick(item.value);\n }}\n >\n {item.label}\n </ix-filter-chip>\n ))\n : ''}\n <div class=\"trigger\">\n <input\n data-testid=\"input\"\n disabled={this.disabled}\n readOnly={this.readonly}\n type=\"text\"\n class={{\n 'allow-clear': this.allowClear && !!this.value?.length,\n }}\n placeholder={\n this.editable\n ? this.i18nPlaceholderEditable\n : this.i18nPlaceholder\n }\n value={this.inputValue}\n ref={(ref) => (this.inputRef = ref)}\n onInput={() => this.filterItemsWithTypeahead()}\n />\n {this.isMultipleMode &&\n this.allowClear &&\n (this.value?.length || this.inputFilterText) ? (\n <ix-icon-button\n class=\"clear\"\n icon=\"clear\"\n ghost\n oval\n size=\"24\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n this.clear();\n }}\n />\n ) : null}\n {this.disabled || this.readonly ? null : (\n <div\n class=\"chevron-down-container\"\n ref={(ref) => {\n if (this.editable) this.dropdownWrapperRef = ref;\n }}\n >\n <ix-icon class=\"chevron\" name=\"chevron-down-small\" />\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n <ix-dropdown\n ref={(ref) => (this.dropdownRef = ref)}\n show={this.dropdownShow}\n class={{\n 'd-none':\n this.disabled ||\n this.readonly ||\n (this.isDropdownEmpty && !this.editable),\n }}\n anchor={this.dropdownAnchor}\n trigger={this.dropdownWrapperRef}\n onShowChanged={(e) => this.dropdownVisibilityChanged(e)}\n placement=\"auto-start\"\n overwriteDropdownStyle={async (delegateConfig) => {\n return {\n width: `${delegateConfig.triggerRef.clientWidth}px`,\n };\n }}\n >\n <div class=\"select-list-header\" title={this.i18nSelectListHeader}>\n {this.i18nSelectListHeader}\n </div>\n <slot></slot>\n <div ref={(ref) => (this.addItemRef = ref)} class=\"d-contents\"></div>\n {this.itemExists(this.inputFilterText) ? (\n ''\n ) : (\n <ix-dropdown-item\n data-testid=\"add-item\"\n icon=\"plus\"\n class={{\n 'add-item': true,\n 'd-none': !(this.editable && this.inputFilterText),\n }}\n label={this.inputFilterText}\n onItemClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n this.emitAddItem(this.inputFilterText);\n }}\n ></ix-dropdown-item>\n )}\n </ix-dropdown>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,SAAS,EACT,OAAO,EACP,K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AE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,eAAe,CAAC;WACnD,EACD,KAAK,EAAE,IAAI,CAAC,eAAe,EAC3B,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;YACjB,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;UACzC,CAAC,GACiB,CACrB,CACW,CACT,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { IxSelectItemLabelChangeEvent } from '../select-item/events';\n\n@Component({\n tag: 'ix-select',\n styleUrl: 'select.scss',\n scoped: true,\n})\nexport class Select {\n @Element() hostElement!: HTMLIxSelectElement;\n\n /**\n * Indices of selected items\n */\n @Prop({ mutable: true }) selectedIndices: string | string[] = [];\n\n /**\n * Show clear button\n */\n @Prop() allowClear = false;\n\n /**\n * Selection mode\n */\n @Prop() mode: 'single' | 'multiple' = 'single';\n\n /**\n * Select is extendable\n */\n @Prop() editable = false;\n\n /**\n * If true the select will be in disabled state\n */\n @Prop() disabled = false;\n\n /**\n * If true the select will be in readonly mode\n */\n @Prop() readonly = false;\n\n /**\n * Input field placeholder\n */\n @Prop() i18nPlaceholder = 'Select an option';\n\n /**\n * Input field placeholder for editable select\n */\n @Prop() i18nPlaceholderEditable = 'Type of select option';\n\n /**\n * Select list header\n */\n @Prop() i18nSelectListHeader = 'Please select an option';\n\n /**\n * Item selection changed\n */\n @Event() itemSelectionChange: EventEmitter<string | string[]>;\n\n /**\n * Item added to selection\n */\n @Event() addItem: EventEmitter<string>;\n\n @State() dropdownShow = false;\n @State() value: string[];\n @State() dropdownWrapperRef!: HTMLElement;\n @State() dropdownAnchor!: HTMLElement;\n @State() isDropdownEmpty = false;\n @State() hasFocus = false;\n @State() navigationItem: HTMLIxSelectItemElement;\n @State() inputFilterText: string;\n @State() inputValue: string;\n\n private inputRef!: HTMLInputElement;\n private dropdownRef!: HTMLIxDropdownElement;\n private addItemRef!: HTMLDivElement;\n\n private labelMutationObserver: MutationObserver;\n\n get items() {\n return Array.from(this.hostElement.querySelectorAll('ix-select-item'));\n }\n\n get selectedItems() {\n return this.items.filter((item) => item.selected);\n }\n\n get addItemButton() {\n return this.hostElement.querySelector('.add-item');\n }\n\n get isSingleMode() {\n return this.mode === 'single';\n }\n\n get isMultipleMode() {\n return this.mode === 'multiple';\n }\n\n @Watch('selectedIndices')\n watchSelectedIndices(newId: string | string[]) {\n if (!newId) {\n this.selectValue([]);\n return;\n }\n\n if (Array.isArray(newId)) {\n this.selectValue([...newId]);\n return;\n }\n\n this.selectValue([newId]);\n }\n\n @Listen('itemClick')\n onItemClicked(event: CustomEvent<string>) {\n const newId = event.detail;\n this.emitItemClick(newId);\n }\n\n @Watch('inputFilterText')\n watchInputText(newValue: string) {\n if (!this.editable) {\n return;\n }\n\n if (this.itemExists(newValue)) {\n return;\n }\n }\n\n private emitItemClick(newId: string) {\n if (this.isMultipleMode && Array.isArray(this.selectedIndices)) {\n if (this.selectedIndices.includes(newId)) {\n this.selectedIndices = this.selectedIndices.filter((i) => i !== newId);\n } else {\n this.selectedIndices = [...this.selectedIndices, newId];\n }\n } else {\n this.selectedIndices = [newId];\n }\n\n this.selectValue(this.selectedIndices);\n this.itemSelectionChange.emit(this.selectedIndices);\n }\n\n private emitAddItem(value: string) {\n if (value.trim() === '') {\n return;\n }\n\n const test = document.createElement('ix-select-item');\n test.value = value;\n test.label = value;\n\n this.addItemRef.appendChild(test);\n\n this.clearInput();\n this.emitItemClick(value);\n this.addItem.emit(value);\n }\n\n private selectValue(ids: string[]) {\n this.items.forEach((item) => {\n item.selected = ids.some((i) => i === item.value);\n });\n\n this.value = this.selectedItems.map((item) => item.label);\n\n if (this.isSingleMode) {\n this.inputValue = this.value?.length ? this.value[0] : null;\n return;\n }\n\n this.inputValue = null;\n }\n\n componentWillLoad() {\n if (this.selectedIndices) {\n this.selectValue(\n Array.isArray(this.selectedIndices)\n ? this.selectedIndices\n : [this.selectedIndices]\n );\n }\n }\n\n @Listen('ix-select-item:labelChange')\n onLabelChange(event: IxSelectItemLabelChangeEvent) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.selectValue(\n Array.isArray(this.selectedIndices)\n ? this.selectedIndices\n : [this.selectedIndices]\n );\n }\n\n disconnectedCallback() {\n if (this.labelMutationObserver) {\n this.labelMutationObserver.disconnect();\n }\n }\n\n private itemExists(item: string) {\n return this.items.find((i) => i.label === item);\n }\n\n private dropdownVisibilityChanged(event: CustomEvent<boolean>) {\n this.dropdownShow = event.detail;\n\n if (event.detail) {\n this.inputRef.focus();\n this.inputRef.select();\n\n this.navigationItem = this.items[0];\n this.setHoverEffectForNavigatedSelectItem();\n this.removeHiddenFromItems();\n }\n this.hasFocus = event.detail;\n }\n\n @Listen('keydown', {\n target: 'window',\n })\n async onKeyDown(event: KeyboardEvent) {\n if (!this.dropdownShow) {\n return;\n }\n\n if (event.code === 'ArrowDown' || event.code === 'ArrowUp') {\n this.onArrowNavigation(event);\n }\n\n if (event.code === 'Enter' || event.code === 'NumpadEnter') {\n await this.onEnterNavigation();\n }\n\n if (event.code === 'Escape') {\n this.dropdownShow = false;\n }\n }\n\n private async onEnterNavigation() {\n if (this.isMultipleMode) {\n return;\n }\n\n if (this.editable && !this.itemExists(this.inputFilterText)) {\n this.emitAddItem(this.inputFilterText);\n this.navigationItem = this.items[this.items.length - 1];\n }\n\n this.navigationItem?.onItemClick();\n await this.dropdownRef?.updatePosition();\n\n if (this.isSingleMode && !this.editable) {\n this.dropdownShow = false;\n }\n }\n\n private onArrowNavigation(event: KeyboardEvent) {\n event.stopPropagation();\n event.preventDefault();\n\n const selectItems = this.items.filter(\n (i) => !i.classList.contains('d-none')\n );\n\n const index = selectItems.indexOf(this.navigationItem);\n\n if (event.code === 'ArrowDown' && index < selectItems.length - 1) {\n this.navigationItem = selectItems[index + 1];\n } else if (event.code === 'ArrowUp' && index > 0) {\n this.navigationItem = selectItems[index - 1];\n }\n\n this.setHoverEffectForNavigatedSelectItem();\n }\n\n private setHoverEffectForNavigatedSelectItem() {\n this.items.forEach((item: HTMLIxSelectItemElement) => {\n item.hover = item === this.navigationItem;\n });\n }\n\n private filterItemsWithTypeahead() {\n this.inputFilterText = this.inputRef.value;\n if (this.inputFilterText) {\n this.items.forEach((item) => {\n item.classList.remove('d-none');\n if (\n !item.label.toLowerCase().includes(this.inputFilterText.toLowerCase())\n ) {\n item.classList.add('d-none');\n }\n });\n } else {\n this.removeHiddenFromItems();\n }\n this.isDropdownEmpty = this.items.every((item) =>\n item.classList.contains('d-none')\n );\n }\n\n private removeHiddenFromItems() {\n this.items.forEach((item) => {\n item.classList.remove('d-none');\n });\n }\n\n private clearInput() {\n this.inputRef.value = '';\n this.inputFilterText = '';\n }\n\n private clear() {\n this.clearInput();\n this.value = [];\n this.selectedIndices = [];\n this.itemSelectionChange.emit(null);\n this.dropdownShow = false;\n }\n\n render() {\n return (\n <Host>\n <div\n class={{\n 'form-control': true,\n select: true,\n focus: this.hasFocus,\n editable: this.editable,\n disabled: this.disabled,\n readonly: this.readonly,\n }}\n ref={(ref) => {\n this.dropdownAnchor = ref;\n if (!this.editable) this.dropdownWrapperRef = ref;\n }}\n >\n <div class=\"input-container\">\n <div class=\"chips\">\n {this.isMultipleMode\n ? this.selectedItems?.map((item) => (\n <ix-filter-chip\n disabled={this.disabled || this.readonly}\n key={item.value}\n onCloseClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n this.emitItemClick(item.value);\n }}\n >\n {item.label}\n </ix-filter-chip>\n ))\n : ''}\n <div class=\"trigger\">\n <input\n data-testid=\"input\"\n disabled={this.disabled}\n readOnly={this.readonly}\n type=\"text\"\n class={{\n 'allow-clear': this.allowClear && !!this.value?.length,\n }}\n placeholder={\n this.editable\n ? this.i18nPlaceholderEditable\n : this.i18nPlaceholder\n }\n value={this.inputValue}\n ref={(ref) => (this.inputRef = ref)}\n onInput={() => this.filterItemsWithTypeahead()}\n />\n {this.isMultipleMode &&\n this.allowClear &&\n (this.value?.length || this.inputFilterText) ? (\n <ix-icon-button\n class=\"clear\"\n icon=\"clear\"\n ghost\n oval\n size=\"24\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n this.clear();\n }}\n />\n ) : null}\n {this.disabled || this.readonly ? null : (\n <div\n class=\"chevron-down-container\"\n ref={(ref) => {\n if (this.editable) this.dropdownWrapperRef = ref;\n }}\n >\n <ix-icon class=\"chevron\" name=\"chevron-down-small\" />\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n <ix-dropdown\n ref={(ref) => (this.dropdownRef = ref)}\n show={this.dropdownShow}\n class={{\n 'd-none':\n this.disabled ||\n this.readonly ||\n (this.isDropdownEmpty && !this.editable),\n }}\n anchor={this.dropdownAnchor}\n trigger={this.dropdownWrapperRef}\n onShowChanged={(e) => this.dropdownVisibilityChanged(e)}\n placement=\"auto-start\"\n overwriteDropdownStyle={async () => {\n return {\n width: `${this.hostElement.clientWidth}px`,\n };\n }}\n >\n <div class=\"select-list-header\" title={this.i18nSelectListHeader}>\n {this.i18nSelectListHeader}\n </div>\n <slot></slot>\n <div ref={(ref) => (this.addItemRef = ref)} class=\"d-contents\"></div>\n {this.itemExists(this.inputFilterText) ? (\n ''\n ) : (\n <ix-dropdown-item\n data-testid=\"add-item\"\n icon=\"plus\"\n class={{\n 'add-item': true,\n 'd-none': !(this.editable && this.inputFilterText),\n }}\n label={this.inputFilterText}\n onItemClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n this.emitAddItem(this.inputFilterText);\n }}\n ></ix-dropdown-item>\n )}\n </ix-dropdown>\n </Host>\n );\n }\n}\n"]}
@@ -6,10 +6,11 @@
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, Host } from '@stencil/core';
9
+ import { h, Host, } from '@stencil/core';
10
10
  import { TypedEvent } from '../utils/typed-event';
11
11
  export class ToastContainer {
12
12
  constructor() {
13
+ this.PREFIX_POSITION_CLASS = 'toast-container--';
13
14
  this.containerId = 'toast-container';
14
15
  this.containerClass = 'toast-container';
15
16
  this.position = 'bottom-right';
@@ -22,10 +23,15 @@ export class ToastContainer {
22
23
  const toastContainer = document.createElement('div');
23
24
  toastContainer.id = this.containerId;
24
25
  toastContainer.classList.add(this.containerClass);
25
- toastContainer.classList.add(`toast-container--${this.position}`);
26
+ toastContainer.classList.add(`${this.PREFIX_POSITION_CLASS}${this.position}`);
26
27
  document.body.appendChild(toastContainer);
27
28
  }
28
29
  }
30
+ onPositionChange(newPosition, oldPosition) {
31
+ const toastContainer = document.getElementById(this.containerId);
32
+ toastContainer.classList.remove(`${this.PREFIX_POSITION_CLASS}${oldPosition}`);
33
+ toastContainer.classList.add(`${this.PREFIX_POSITION_CLASS}${newPosition}`);
34
+ }
29
35
  /**
30
36
  * Display a toast message
31
37
  * @param config
@@ -108,8 +114,8 @@ export class ToastContainer {
108
114
  "type": "string",
109
115
  "mutable": false,
110
116
  "complexType": {
111
- "original": "string",
112
- "resolved": "string",
117
+ "original": "'bottom-right' | 'top-right'",
118
+ "resolved": "\"bottom-right\" | \"top-right\"",
113
119
  "references": {}
114
120
  },
115
121
  "required": false,
@@ -165,5 +171,11 @@ export class ToastContainer {
165
171
  };
166
172
  }
167
173
  static get elementRef() { return "host"; }
174
+ static get watchers() {
175
+ return [{
176
+ "propName": "position",
177
+ "methodName": "onPositionChange"
178
+ }];
179
+ }
168
180
  }
169
181
  //# sourceMappingURL=toast-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toast-container.js","sourceRoot":"","sources":["../../../src/components/toast/toast-container.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOlD,MAAM,OAAO,cAAc;;uBAKH,iBAAiB;0BAId,iBAAiB;oBAIvB,cAAc;;EAEjC,IAAI,aAAa;IACf,OAAO,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;EACnD,CAAC;EAED,gBAAgB;IACd,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;MAC9C,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;MACrD,cAAc,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC;MACrC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;MAClD,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;MAClE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;KAC3C;EACH,CAAC;EAED;;;KAGG;EAEH,KAAK,CAAC,SAAS,CAAC,MAAmB;IACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAEjD,MAAM,OAA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":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { Component, Element, h, Host, Method, Prop } from '@stencil/core';\nimport { TypedEvent } from '../utils/typed-event';\nimport { ToastConfig } from './toast-utils';\n\n@Component({\n tag: 'ix-toast-container',\n scoped: true,\n})\nexport class ToastContainer {\n @Element() host!: HTMLIxToastContainerElement;\n\n /**\n */\n @Prop() containerId = 'toast-container';\n\n /**\n */\n @Prop() containerClass = 'toast-container';\n\n /**\n */\n @Prop() position = 'bottom-right';\n\n get hostContainer() {\n return document.getElementById(this.containerId);\n }\n\n componentDidLoad() {\n if (!document.getElementById(this.containerId)) {\n const toastContainer = document.createElement('div');\n toastContainer.id = this.containerId;\n toastContainer.classList.add(this.containerClass);\n toastContainer.classList.add(`toast-container--${this.position}`);\n document.body.appendChild(toastContainer);\n }\n }\n\n /**\n * Display a toast message\n * @param config\n */\n @Method()\n async showToast(config: ToastConfig) {\n const toast = document.createElement('ix-toast');\n\n const onClose = new TypedEvent<any | undefined>();\n\n function removeToast(result?: any) {\n toast.remove();\n onClose.emit(result);\n }\n\n toast.toastTitle = config.title;\n toast.type = config.type;\n toast.autoClose = config.autoClose;\n toast.autoCloseDelay = config.autoCloseDelay;\n toast.icon = config.icon;\n toast.iconColor = config.iconColor;\n toast.addEventListener(\n 'closeToast',\n (event: CustomEvent<any | undefined>) => {\n const { detail } = event;\n removeToast(detail);\n }\n );\n\n if (typeof config.message === 'string') {\n toast.innerText = config.message;\n } else {\n toast.appendChild(config.message);\n }\n\n this.hostContainer.appendChild(toast);\n\n return {\n onClose,\n close: (result?: any) => {\n removeToast(result);\n },\n };\n }\n\n render() {\n return <Host></Host>;\n }\n}\n"]}
1
+ {"version":3,"file":"toast-container.js","sourceRoot":"","sources":["../../../src/components/toast/toast-container.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n h,\n Host,\n Method,\n Prop,\n Watch,\n} from '@stencil/core';\nimport { TypedEvent } from '../utils/typed-event';\nimport { ToastConfig } from './toast-utils';\n\n@Component({\n tag: 'ix-toast-container',\n scoped: true,\n})\nexport class ToastContainer {\n @Element() host!: HTMLIxToastContainerElement;\n\n /**\n */\n @Prop() containerId = 'toast-container';\n\n /**\n */\n @Prop() containerClass = 'toast-container';\n\n /**\n */\n @Prop() position: 'bottom-right' | 'top-right' = 'bottom-right';\n\n private readonly PREFIX_POSITION_CLASS = 'toast-container--';\n\n get hostContainer() {\n return document.getElementById(this.containerId);\n }\n\n componentDidLoad() {\n if (!document.getElementById(this.containerId)) {\n const toastContainer = document.createElement('div');\n toastContainer.id = this.containerId;\n toastContainer.classList.add(this.containerClass);\n toastContainer.classList.add(\n `${this.PREFIX_POSITION_CLASS}${this.position}`\n );\n document.body.appendChild(toastContainer);\n }\n }\n\n @Watch('position')\n onPositionChange(newPosition: string, oldPosition: string) {\n const toastContainer = document.getElementById(this.containerId);\n toastContainer.classList.remove(\n `${this.PREFIX_POSITION_CLASS}${oldPosition}`\n );\n toastContainer.classList.add(`${this.PREFIX_POSITION_CLASS}${newPosition}`);\n }\n\n /**\n * Display a toast message\n * @param config\n */\n @Method()\n async showToast(config: ToastConfig) {\n const toast = document.createElement('ix-toast');\n\n const onClose = new TypedEvent<any | undefined>();\n\n function removeToast(result?: any) {\n toast.remove();\n onClose.emit(result);\n }\n\n toast.toastTitle = config.title;\n toast.type = config.type;\n toast.autoClose = config.autoClose;\n toast.autoCloseDelay = config.autoCloseDelay;\n toast.icon = config.icon;\n toast.iconColor = config.iconColor;\n toast.addEventListener(\n 'closeToast',\n (event: CustomEvent<any | undefined>) => {\n const { detail } = event;\n removeToast(detail);\n }\n );\n\n if (typeof config.message === 'string') {\n toast.innerText = config.message;\n } else {\n toast.appendChild(config.message);\n }\n\n this.hostContainer.appendChild(toast);\n\n return {\n onClose,\n close: (result?: any) => {\n removeToast(result);\n },\n };\n }\n\n render() {\n return <Host></Host>;\n }\n}\n"]}
@@ -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
- function getToastContainer() {
9
+ export function getToastContainer() {
10
10
  const containerList = Array.from(document.querySelectorAll('ix-toast-container'));
11
11
  const [container] = containerList;
12
12
  if (containerList.length > 1) {
@@ -20,6 +20,9 @@ function getToastContainer() {
20
20
  }
21
21
  return container;
22
22
  }
23
+ export function setToastPosition(position) {
24
+ getToastContainer().position = position;
25
+ }
23
26
  async function toast(config) {
24
27
  const context = getToastContainer();
25
28
  const toast = await context.showToast(config);
@@ -1 +1 @@
1
- {"version":3,"file":"toast-utils.js","sourceRoot":"","sources":["../../../src/components/toast/toast-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH,SAAS,iBAAiB;EACxB,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAC9B,QAAQ,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAChD,CAAC;EACF,MAAM,CAAC,SAAS,CAAC,GAAG,aAAa,CAAC;EAClC,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;IAC5B,OAAO,CAAC,IAAI,CACV,+DAA+D,CAChE,CAAC;IACF,OAAO,SAAS,CAAC;GAClB;EACD,IAAI,CAAC,SAAS,EAAE;IACd,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;IACpE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAE1C,OAAO,cAAc,CAAC;GACvB;EACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,KAAK,UAAU,KAAK,CAAC,MAAmB;EACtC,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;EACpC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;EAC9C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,KAAK,CAAC,IAAI,GAAG,CAAC,MAAmB,EAAE,EAAE;EACnC,OAAO,KAAK,iCACP,MAAM,KACT,IAAI,EAAE,MAAM,IACZ,CAAC;AACL,CAAC,CAAC;AAEF,KAAK,CAAC,KAAK,GAAG,CAAC,MAAmB,EAAE,EAAE;EACpC,OAAO,KAAK,iCACP,MAAM,KACT,IAAI,EAAE,OAAO,IACb,CAAC;AACL,CAAC,CAAC;AAEF,KAAK,CAAC,OAAO,GAAG,CAAC,MAAmB,EAAE,EAAE;EACtC,OAAO,KAAK,iCACP,MAAM,KACT,IAAI,EAAE,SAAS,IACf,CAAC;AACL,CAAC,CAAC;AAEF,KAAK,CAAC,OAAO,GAAG,CAAC,MAAmB,EAAE,EAAE;EACtC,OAAO,KAAK,iCACP,MAAM,KACT,IAAI,EAAE,SAAS,IACf,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport type ToastType = 'info' | 'success' | 'error' | 'warning';\n\nexport interface ToastConfig {\n title?: string;\n message: string | HTMLElement;\n type?: ToastType;\n autoClose?: boolean;\n autoCloseDelay?: number;\n icon?: string;\n iconColor?: string;\n}\n\nfunction getToastContainer() {\n const containerList = Array.from(\n document.querySelectorAll('ix-toast-container')\n );\n const [container] = containerList;\n if (containerList.length > 1) {\n console.warn(\n 'Multiple toast container are found. Only there first is used.'\n );\n return container;\n }\n if (!container) {\n const toastContainer = document.createElement('ix-toast-container');\n document.body.appendChild(toastContainer);\n\n return toastContainer;\n }\n return container;\n}\n\nasync function toast(config: ToastConfig) {\n const context = getToastContainer();\n const toast = await context.showToast(config);\n return toast;\n}\n\ntoast.info = (config: ToastConfig) => {\n return toast({\n ...config,\n type: 'info',\n });\n};\n\ntoast.error = (config: ToastConfig) => {\n return toast({\n ...config,\n type: 'error',\n });\n};\n\ntoast.success = (config: ToastConfig) => {\n return toast({\n ...config,\n type: 'success',\n });\n};\n\ntoast.warning = (config: ToastConfig) => {\n return toast({\n ...config,\n type: 'warning',\n });\n};\n\nexport { toast };\n"]}
1
+ {"version":3,"file":"toast-utils.js","sourceRoot":"","sources":["../../../src/components/toast/toast-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH,MAAM,UAAU,iBAAiB;EAC/B,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAC9B,QAAQ,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAChD,CAAC;EACF,MAAM,CAAC,SAAS,CAAC,GAAG,aAAa,CAAC;EAClC,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;IAC5B,OAAO,CAAC,IAAI,CACV,+DAA+D,CAChE,CAAC;IACF,OAAO,SAAS,CAAC;GAClB;EACD,IAAI,CAAC,SAAS,EAAE;IACd,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;IACpE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAE1C,OAAO,cAAc,CAAC;GACvB;EACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAuB;EACtD,iBAAiB,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC1C,CAAC;AAED,KAAK,UAAU,KAAK,CAAC,MAAmB;EACtC,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;EACpC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;EAC9C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,KAAK,CAAC,IAAI,GAAG,CAAC,MAAmB,EAAE,EAAE;EACnC,OAAO,KAAK,iCACP,MAAM,KACT,IAAI,EAAE,MAAM,IACZ,CAAC;AACL,CAAC,CAAC;AAEF,KAAK,CAAC,KAAK,GAAG,CAAC,MAAmB,EAAE,EAAE;EACpC,OAAO,KAAK,iCACP,MAAM,KACT,IAAI,EAAE,OAAO,IACb,CAAC;AACL,CAAC,CAAC;AAEF,KAAK,CAAC,OAAO,GAAG,CAAC,MAAmB,EAAE,EAAE;EACtC,OAAO,KAAK,iCACP,MAAM,KACT,IAAI,EAAE,SAAS,IACf,CAAC;AACL,CAAC,CAAC;AAEF,KAAK,CAAC,OAAO,GAAG,CAAC,MAAmB,EAAE,EAAE;EACtC,OAAO,KAAK,iCACP,MAAM,KACT,IAAI,EAAE,SAAS,IACf,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport type ToastType = 'info' | 'success' | 'error' | 'warning';\nexport type ToastPosition = 'bottom-right' | 'top-right';\n\nexport interface ToastConfig {\n title?: string;\n message: string | HTMLElement;\n type?: ToastType;\n autoClose?: boolean;\n autoCloseDelay?: number;\n icon?: string;\n iconColor?: string;\n}\n\nexport function getToastContainer() {\n const containerList = Array.from(\n document.querySelectorAll('ix-toast-container')\n );\n const [container] = containerList;\n if (containerList.length > 1) {\n console.warn(\n 'Multiple toast container are found. Only there first is used.'\n );\n return container;\n }\n if (!container) {\n const toastContainer = document.createElement('ix-toast-container');\n document.body.appendChild(toastContainer);\n\n return toastContainer;\n }\n return container;\n}\n\nexport function setToastPosition(position: ToastPosition) {\n getToastContainer().position = position;\n}\n\nasync function toast(config: ToastConfig) {\n const context = getToastContainer();\n const toast = await context.showToast(config);\n return toast;\n}\n\ntoast.info = (config: ToastConfig) => {\n return toast({\n ...config,\n type: 'info',\n });\n};\n\ntoast.error = (config: ToastConfig) => {\n return toast({\n ...config,\n type: 'error',\n });\n};\n\ntoast.success = (config: ToastConfig) => {\n return toast({\n ...config,\n type: 'success',\n });\n};\n\ntoast.warning = (config: ToastConfig) => {\n return toast({\n ...config,\n type: 'warning',\n });\n};\n\nexport { toast };\n"]}
@@ -1,11 +1,12 @@
1
1
  :host {
2
2
  display: inline-block;
3
- position: absolute;
3
+ position: fixed;
4
4
  left: 0px;
5
5
  top: 0px;
6
+ z-index: var(--theme-z-index-tooltip);
6
7
  max-width: 18.25rem;
7
8
  opacity: 0;
8
- visibility: collapse;
9
+ visibility: collapse !important;
9
10
  overflow-wrap: break-word;
10
11
  border-radius: 0.25rem;
11
12
  background-color: var(--theme-tootlip--background);
@@ -22,20 +23,20 @@
22
23
 
23
24
  :host(.visible) {
24
25
  opacity: 1;
25
- visibility: visible;
26
+ visibility: visible !important;
26
27
  }
27
28
 
28
- :host .arrow,
29
- :host .arrow::before {
29
+ :host(.visible) .arrow,
30
+ :host(.visible) .arrow::before {
30
31
  position: absolute;
31
32
  width: 8px;
32
33
  height: 8px;
33
34
  background: inherit;
34
35
  }
35
- :host .arrow {
36
+ :host(.visible) .arrow {
36
37
  visibility: hidden;
37
38
  }
38
- :host .arrow::before {
39
+ :host(.visible) .arrow::before {
39
40
  visibility: visible;
40
41
  content: "";
41
42
  transform: rotate(45deg);