@sellmate/design-system 1.0.40 → 1.0.42

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 (249) hide show
  1. package/dist/cjs/component.textinput-43trvZ5m.js +41 -0
  2. package/dist/cjs/design-system.cjs.js +1 -1
  3. package/dist/cjs/index.cjs.js +0 -9
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/sd-barcode-input.cjs.entry.js +162 -0
  6. package/dist/cjs/sd-button-v2_2.cjs.entry.js +4 -4
  7. package/dist/cjs/sd-button_20.cjs.entry.js +44 -69
  8. package/dist/cjs/sd-card.cjs.entry.js +1 -1
  9. package/dist/cjs/sd-confirm-modal.cjs.entry.js +124 -0
  10. package/dist/cjs/sd-date-picker.cjs.entry.js +1 -1
  11. package/dist/cjs/sd-dropdown-button.cjs.entry.js +3 -3
  12. package/dist/cjs/sd-file-picker.cjs.entry.js +3 -3
  13. package/dist/cjs/sd-guide.cjs.entry.js +2 -2
  14. package/dist/cjs/sd-modal-container.cjs.entry.js +17 -73
  15. package/dist/cjs/sd-popover.cjs.entry.js +10 -2
  16. package/dist/cjs/sd-progress.cjs.entry.js +2 -2
  17. package/dist/cjs/sd-select-group.cjs.entry.js +1 -1
  18. package/dist/cjs/sd-select-multiple.cjs.entry.js +1 -1
  19. package/dist/cjs/sd-select-option-group.cjs.entry.js +3 -3
  20. package/dist/cjs/sd-select-v2-list-item_2.cjs.entry.js +7 -16
  21. package/dist/cjs/sd-select-v2-listbox_2.cjs.entry.js +181 -14
  22. package/dist/cjs/sd-select-v2.cjs.entry.js +13 -21
  23. package/dist/cjs/{sd-select-v2.config-DZrPJ6OS.js → sd-select-v2.config-BJXi4hMP.js} +12 -7
  24. package/dist/cjs/sd-text-link.cjs.entry.js +3 -3
  25. package/dist/cjs/sd-toast-container.cjs.entry.js +1 -1
  26. package/dist/cjs/sd-toast.cjs.entry.js +2 -2
  27. package/dist/cjs/sd-toggle-button.cjs.entry.js +1 -1
  28. package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
  29. package/dist/collection/collection-manifest.json +1 -1
  30. package/dist/collection/components/sd-barcode-input/sd-barcode-input.config.js +34 -0
  31. package/dist/collection/components/sd-barcode-input/sd-barcode-input.css +72 -0
  32. package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +750 -0
  33. package/dist/collection/components/sd-button-v2/sd-button-v2.js +2 -2
  34. package/dist/collection/components/sd-card/sd-card.js +1 -1
  35. package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.config.js +4 -1
  36. package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.css +17 -17
  37. package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +7 -7
  38. package/dist/collection/components/sd-date-picker/sd-date-picker.js +1 -1
  39. package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +4 -4
  40. package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +3 -3
  41. package/dist/collection/components/sd-field/sd-field.js +4 -3
  42. package/dist/collection/components/sd-file-picker/sd-file-picker.js +3 -3
  43. package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
  44. package/dist/collection/components/sd-guide/sd-guide.js +2 -2
  45. package/dist/collection/components/sd-icon/sd-icon.js +1 -1
  46. package/dist/collection/components/sd-input/sd-input.js +2 -2
  47. package/dist/collection/components/sd-loading-spinner/sd-loading-spinner.js +1 -1
  48. package/dist/collection/components/sd-modal-container/sd-modal-container.js +19 -118
  49. package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
  50. package/dist/collection/components/sd-pagination/sd-pagination.js +2 -2
  51. package/dist/collection/components/sd-popover/sd-popover.js +10 -2
  52. package/dist/collection/components/sd-portal/sd-portal.js +1 -1
  53. package/dist/collection/components/sd-progress/sd-progress.js +2 -2
  54. package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js +2 -2
  55. package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
  56. package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js +3 -3
  57. package/dist/collection/components/sd-select-group/sd-select-group.js +1 -1
  58. package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +1 -1
  59. package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
  60. package/dist/collection/components/sd-select-v2/sd-select-v2-list-item/sd-select-v2-list-item.css +6 -6
  61. package/dist/collection/components/sd-select-v2/sd-select-v2-list-item/sd-select-v2-list-item.js +2 -2
  62. package/dist/collection/components/sd-select-v2/sd-select-v2-list-item-search/sd-select-v2-list-item-search.js +3 -12
  63. package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.css +1 -0
  64. package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.js +185 -16
  65. package/dist/collection/components/sd-select-v2/sd-select-v2-trigger/sd-select-v2-trigger.js +2 -2
  66. package/dist/collection/components/sd-select-v2/sd-select-v2.config.js +12 -7
  67. package/dist/collection/components/sd-select-v2/sd-select-v2.js +13 -21
  68. package/dist/collection/components/sd-tag/sd-tag.js +2 -2
  69. package/dist/collection/components/sd-text-link/sd-text-link.js +3 -3
  70. package/dist/collection/components/sd-textarea/sd-textarea.js +2 -2
  71. package/dist/collection/components/sd-toast/sd-toast.js +2 -2
  72. package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
  73. package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
  74. package/dist/collection/components/sd-toggle-button/sd-toggle-button.js +1 -1
  75. package/dist/collection/components/sd-tooltip/sd-tooltip.js +10 -2
  76. package/dist/collection/utils/modal.js +0 -9
  77. package/dist/components/index.js +1 -1
  78. package/dist/components/{p-8oyZJ0FK.js → p-6FZWkn3V.js} +1 -1
  79. package/dist/components/p-AfdVu7_V.js +1 -0
  80. package/dist/components/{p-PcxVERcm.js → p-B2IPxQNl.js} +1 -1
  81. package/dist/components/{p-DBCQtIY4.js → p-BBKrHUCP.js} +1 -1
  82. package/dist/components/{p-A5atk1St.js → p-BKtAiyh0.js} +1 -1
  83. package/dist/components/{p-5UN9Ry8A.js → p-BXuZFSsU.js} +1 -1
  84. package/dist/components/{p-CZN_I4v-.js → p-BZJDhQ6h.js} +1 -1
  85. package/dist/components/{p-CKi7RueC.js → p-BfqA9RSe.js} +1 -1
  86. package/dist/components/{p-2JXqy61T.js → p-Bo7U7jA2.js} +1 -1
  87. package/dist/components/{p-VztCEgcN.js → p-C7dgr7sG.js} +1 -1
  88. package/dist/components/p-CArAuWdh.js +1 -0
  89. package/dist/components/{p-vznqVg6E.js → p-CPr3lzac.js} +1 -1
  90. package/dist/components/{p-DEBuE-pW.js → p-CV1qJByG.js} +1 -1
  91. package/dist/components/p-CXjMXCNh.js +1 -0
  92. package/dist/components/p-CbjDAdZ_.js +1 -0
  93. package/dist/components/p-CnZPI5RL.js +1 -0
  94. package/dist/components/{p-du_AmhYu.js → p-CrJXDjO0.js} +1 -1
  95. package/dist/components/{p-DtCG-y6d.js → p-Cx2K_zB2.js} +1 -1
  96. package/dist/components/{p-CJZIwyH-.js → p-D3H3ILJG.js} +1 -1
  97. package/dist/components/{p-BNNjhCQc.js → p-DgDoP1wQ.js} +1 -1
  98. package/dist/components/{p-DPjPJkXv.js → p-DvQzT5XM.js} +1 -1
  99. package/dist/components/{p-CjZTu6hh.js → p-UaMNiu8y.js} +1 -1
  100. package/dist/components/p-gHb970iC.js +1 -0
  101. package/dist/components/p-jaHdAlr9.js +1 -0
  102. package/dist/components/{p-Ese2dRYD.js → p-jk3tAdJg.js} +1 -1
  103. package/dist/components/p-qbtTff3q.js +1 -0
  104. package/dist/components/{sd-notice-modal.d.ts → sd-barcode-input.d.ts} +4 -4
  105. package/dist/components/sd-barcode-input.js +1 -0
  106. package/dist/components/sd-button-v2.js +1 -1
  107. package/dist/components/sd-button.js +1 -1
  108. package/dist/components/sd-calendar.js +1 -1
  109. package/dist/components/sd-card.js +1 -1
  110. package/dist/components/sd-checkbox.js +1 -1
  111. package/dist/components/sd-confirm-modal.js +1 -1
  112. package/dist/components/sd-date-picker.js +1 -1
  113. package/dist/components/sd-date-range-picker.js +1 -1
  114. package/dist/components/sd-dropdown-button.js +1 -1
  115. package/dist/components/sd-field.js +1 -1
  116. package/dist/components/sd-file-picker.js +1 -1
  117. package/dist/components/sd-floating-portal.js +1 -1
  118. package/dist/components/sd-guide.js +1 -1
  119. package/dist/components/sd-icon.js +1 -1
  120. package/dist/components/sd-input.js +1 -1
  121. package/dist/components/sd-loading-spinner.js +1 -1
  122. package/dist/components/sd-modal-container.js +1 -1
  123. package/dist/components/sd-number-input.js +1 -1
  124. package/dist/components/sd-pagination.js +1 -1
  125. package/dist/components/sd-popover.js +1 -1
  126. package/dist/components/sd-portal.js +1 -1
  127. package/dist/components/sd-progress.js +1 -1
  128. package/dist/components/sd-select-dropdown.js +1 -1
  129. package/dist/components/sd-select-group.js +1 -1
  130. package/dist/components/sd-select-multiple-group.js +1 -1
  131. package/dist/components/sd-select-multiple.js +1 -1
  132. package/dist/components/sd-select-option-group.js +1 -1
  133. package/dist/components/sd-select-option.js +1 -1
  134. package/dist/components/sd-select-search-input.js +1 -1
  135. package/dist/components/sd-select-v2-list-item-search.js +1 -1
  136. package/dist/components/sd-select-v2-list-item.js +1 -1
  137. package/dist/components/sd-select-v2-listbox.js +1 -1
  138. package/dist/components/sd-select-v2-trigger.js +1 -1
  139. package/dist/components/sd-select-v2.js +1 -1
  140. package/dist/components/sd-select.js +1 -1
  141. package/dist/components/sd-table.js +1 -1
  142. package/dist/components/sd-tabs.js +1 -1
  143. package/dist/components/sd-tag.js +1 -1
  144. package/dist/components/sd-text-link.js +1 -1
  145. package/dist/components/sd-textarea.js +1 -1
  146. package/dist/components/sd-toast-container.js +1 -1
  147. package/dist/components/sd-toast.js +1 -1
  148. package/dist/components/sd-toggle-button.js +1 -1
  149. package/dist/components/sd-toggle.js +1 -1
  150. package/dist/components/sd-tooltip.js +1 -1
  151. package/dist/design-system/design-system.css +1 -1
  152. package/dist/design-system/design-system.esm.js +1 -1
  153. package/dist/design-system/index.esm.js +1 -1
  154. package/dist/design-system/p-0174f3c5.entry.js +1 -0
  155. package/dist/design-system/{p-8e0cc9be.entry.js → p-0dee408f.entry.js} +1 -1
  156. package/dist/design-system/{p-fb71301e.entry.js → p-4301b50d.entry.js} +1 -1
  157. package/dist/design-system/p-4921c569.entry.js +1 -0
  158. package/dist/design-system/{p-2408d1ab.entry.js → p-50b1196b.entry.js} +1 -1
  159. package/dist/design-system/p-535b0778.entry.js +1 -0
  160. package/dist/design-system/{p-7ce76a05.entry.js → p-57b1e335.entry.js} +1 -1
  161. package/dist/design-system/{p-6a34e6b8.entry.js → p-5ce3142c.entry.js} +1 -1
  162. package/dist/design-system/{p-d8b04e91.entry.js → p-634797a4.entry.js} +1 -1
  163. package/dist/design-system/{p-b71d0858.entry.js → p-63a43fc9.entry.js} +1 -1
  164. package/dist/design-system/{p-72b09ede.entry.js → p-6a371d98.entry.js} +1 -1
  165. package/dist/design-system/p-6db4e8c7.entry.js +1 -0
  166. package/dist/design-system/{p-36ba5f33.entry.js → p-7368eb09.entry.js} +1 -1
  167. package/dist/design-system/p-868ce552.entry.js +1 -0
  168. package/dist/design-system/p-9eea4660.entry.js +1 -0
  169. package/dist/design-system/p-CbjDAdZ_.js +1 -0
  170. package/dist/design-system/{p-9933475e.entry.js → p-aaf91535.entry.js} +1 -1
  171. package/dist/design-system/{p-e96c881f.entry.js → p-c1963b5e.entry.js} +1 -1
  172. package/dist/design-system/{p-63f997d7.entry.js → p-dc6246be.entry.js} +1 -1
  173. package/dist/design-system/p-e39687d0.entry.js +1 -0
  174. package/dist/design-system/p-f91f4fcc.entry.js +1 -0
  175. package/dist/design-system/{p-f9075737.entry.js → p-f9cf0d6f.entry.js} +1 -1
  176. package/dist/design-system/{p-b79756cc.entry.js → p-fdde3de0.entry.js} +1 -1
  177. package/dist/design-system/p-feb80c2f.entry.js +1 -0
  178. package/dist/design-system/{p-BOmBg3kj.js → p-o9Ugc4Ua.js} +1 -1
  179. package/dist/esm/component.textinput-CbjDAdZ_.js +39 -0
  180. package/dist/esm/design-system.js +1 -1
  181. package/dist/esm/index.js +0 -9
  182. package/dist/esm/loader.js +1 -1
  183. package/dist/esm/sd-barcode-input.entry.js +160 -0
  184. package/dist/esm/sd-button-v2_2.entry.js +4 -4
  185. package/dist/esm/sd-button_20.entry.js +39 -64
  186. package/dist/esm/sd-card.entry.js +1 -1
  187. package/dist/esm/sd-confirm-modal.entry.js +122 -0
  188. package/dist/esm/sd-date-picker.entry.js +1 -1
  189. package/dist/esm/sd-dropdown-button.entry.js +3 -3
  190. package/dist/esm/sd-file-picker.entry.js +3 -3
  191. package/dist/esm/sd-guide.entry.js +2 -2
  192. package/dist/esm/sd-modal-container.entry.js +17 -73
  193. package/dist/esm/sd-popover.entry.js +10 -2
  194. package/dist/esm/sd-progress.entry.js +2 -2
  195. package/dist/esm/sd-select-group.entry.js +1 -1
  196. package/dist/esm/sd-select-multiple.entry.js +1 -1
  197. package/dist/esm/sd-select-option-group.entry.js +3 -3
  198. package/dist/esm/sd-select-v2-list-item_2.entry.js +7 -16
  199. package/dist/esm/sd-select-v2-listbox_2.entry.js +181 -14
  200. package/dist/esm/{sd-select-v2.config-BOmBg3kj.js → sd-select-v2.config-o9Ugc4Ua.js} +12 -7
  201. package/dist/esm/sd-select-v2.entry.js +13 -21
  202. package/dist/esm/sd-text-link.entry.js +3 -3
  203. package/dist/esm/sd-toast-container.entry.js +1 -1
  204. package/dist/esm/sd-toast.entry.js +2 -2
  205. package/dist/esm/sd-toggle-button.entry.js +1 -1
  206. package/dist/esm/sd-toggle.entry.js +1 -1
  207. package/dist/types/components/sd-barcode-input/sd-barcode-input.config.d.ts +38 -0
  208. package/dist/types/components/sd-barcode-input/sd-barcode-input.d.ts +50 -0
  209. package/dist/types/components/sd-confirm-modal/sd-confirm-modal.config.d.ts +4 -3
  210. package/dist/types/components/sd-confirm-modal/sd-confirm-modal.d.ts +1 -1
  211. package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +3 -13
  212. package/dist/types/components/sd-modal-container/sd-modal-container.d.ts +2 -5
  213. package/dist/types/components/sd-popover/sd-popover.d.ts +1 -0
  214. package/dist/types/components/sd-select-v2/sd-select-v2-list-item-search/sd-select-v2-list-item-search.d.ts +0 -1
  215. package/dist/types/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.d.ts +44 -2
  216. package/dist/types/components/sd-select-v2/sd-select-v2.config.d.ts +4 -0
  217. package/dist/types/components/sd-select-v2/sd-select-v2.d.ts +0 -1
  218. package/dist/types/components/sd-tooltip/sd-tooltip.d.ts +1 -0
  219. package/dist/types/components.d.ts +249 -130
  220. package/dist/types/index.d.ts +1 -1
  221. package/dist/types/utils/modal.d.ts +3 -4
  222. package/hydrate/index.js +584 -368
  223. package/hydrate/index.mjs +584 -368
  224. package/package.json +1 -1
  225. package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +0 -199
  226. package/dist/collection/components/sd-notice-modal/sd-notice-modal.config.js +0 -3
  227. package/dist/collection/components/sd-notice-modal/sd-notice-modal.css +0 -61
  228. package/dist/collection/components/sd-notice-modal/sd-notice-modal.js +0 -324
  229. package/dist/components/p-BDUKWznE.js +0 -1
  230. package/dist/components/p-BzfvfP0u.js +0 -1
  231. package/dist/components/p-C-AFCWLs.js +0 -1
  232. package/dist/components/p-CN-WKnUJ.js +0 -1
  233. package/dist/components/p-C_L-UaCP.js +0 -1
  234. package/dist/components/p-CrYrMUpQ.js +0 -1
  235. package/dist/components/p-D0PYeSW9.js +0 -1
  236. package/dist/components/p-DLe_Tu-I.js +0 -1
  237. package/dist/components/p-H9Vl4enQ.js +0 -1
  238. package/dist/components/sd-notice-modal.js +0 -1
  239. package/dist/design-system/p-10945e57.entry.js +0 -1
  240. package/dist/design-system/p-342f48ab.entry.js +0 -1
  241. package/dist/design-system/p-3ded14dc.entry.js +0 -1
  242. package/dist/design-system/p-951e5615.entry.js +0 -1
  243. package/dist/design-system/p-9c6fea35.entry.js +0 -1
  244. package/dist/design-system/p-9d431ea6.entry.js +0 -1
  245. package/dist/design-system/p-ba393cc8.entry.js +0 -1
  246. package/dist/design-system/p-df1f9832.entry.js +0 -1
  247. package/dist/esm/sd-confirm-modal_2.entry.js +0 -196
  248. package/dist/types/components/sd-notice-modal/sd-notice-modal.config.d.ts +0 -5
  249. package/dist/types/components/sd-notice-modal/sd-notice-modal.d.ts +0 -28
@@ -25,7 +25,7 @@ const SdModalContainer = class {
25
25
  this.shakeModal(top.modalEl);
26
26
  return;
27
27
  }
28
- this.requestDismiss(top.id, 'cancel');
28
+ this.requestDismiss(top.id, 'close');
29
29
  }
30
30
  }
31
31
  async open(options, chain) {
@@ -35,33 +35,7 @@ const SdModalContainer = class {
35
35
  clearTimeout(this.containerDismissTimerId);
36
36
  this.containerDismissTimerId = undefined;
37
37
  }
38
- this.entries = [...(this.entries ?? []), { id, modalEl, chain, persistent: !!options.persistent, closing: false }];
39
- this.isVisible = true;
40
- // Append after the container renders, then wait until the modal can paint before starting transitions.
41
- requestAnimationFrame(() => {
42
- if (this.contentRef) {
43
- this.contentRef.appendChild(modalEl);
44
- this.waitForModalReady(modalEl).then(() => {
45
- requestAnimationFrame(() => {
46
- const currentEntry = (this.entries ?? []).find(item => item.id === id);
47
- if (!currentEntry || currentEntry.closing || !modalEl.isConnected)
48
- return;
49
- this.isBackdropVisible = true;
50
- modalEl.classList.add('sd-modal-container__modal--visible');
51
- });
52
- });
53
- }
54
- });
55
- return id;
56
- }
57
- async openNotice(options, chain) {
58
- const id = `modal-${++modalIdCounter}`;
59
- const modalEl = this.createNoticeModal(id, options);
60
- if (this.containerDismissTimerId) {
61
- clearTimeout(this.containerDismissTimerId);
62
- this.containerDismissTimerId = undefined;
63
- }
64
- this.entries = [...(this.entries ?? []), { id, modalEl, chain, persistent: !!options.persistent, closing: false }];
38
+ this.entries = [...(this.entries ?? []), { id, modalEl, chain, persistent: !!options.persistent, closeAction: options.closeAction ?? 'none', closing: false }];
65
39
  this.isVisible = true;
66
40
  requestAnimationFrame(() => {
67
41
  if (this.contentRef) {
@@ -90,11 +64,11 @@ const SdModalContainer = class {
90
64
  el.setAttribute('data-modal-id', id);
91
65
  el.classList.add('sd-modal-container__modal');
92
66
  this.applyProps(el, options);
93
- el.addEventListener('sdConfirm', () => {
67
+ el.addEventListener('sdOk', () => {
94
68
  this.requestDismiss(id, 'confirm');
95
69
  });
96
70
  el.addEventListener('sdClose', () => {
97
- this.requestDismiss(id, 'cancel');
71
+ this.requestDismiss(id, 'close');
98
72
  });
99
73
  return el;
100
74
  }
@@ -127,43 +101,6 @@ const SdModalContainer = class {
127
101
  if (this.hasOwnProp(options, 'tagContents'))
128
102
  el.tagContents = options.tagContents;
129
103
  }
130
- createNoticeModal(id, options) {
131
- const el = document.createElement('sd-notice-modal');
132
- el.setAttribute('data-modal-id', id);
133
- el.classList.add('sd-modal-container__modal');
134
- this.applyNoticeProps(el, options);
135
- el.addEventListener('sdConfirm', () => {
136
- this.requestDismiss(id, 'confirm');
137
- });
138
- el.addEventListener('sdClose', () => {
139
- this.requestDismiss(id, 'cancel');
140
- });
141
- return el;
142
- }
143
- applyNoticeProps(el, options) {
144
- if (this.hasOwnProp(options, 'title'))
145
- this.setAttr(el, 'modal-title', options.title);
146
- if (this.hasOwnProp(options, 'titleClass'))
147
- this.setAttr(el, 'title-class', options.titleClass);
148
- if (this.hasOwnProp(options, 'mainButtonLabel')) {
149
- this.setAttr(el, 'main-button-label', options.mainButtonLabel);
150
- }
151
- if (this.hasOwnProp(options, 'subButtonLabel')) {
152
- this.setAttr(el, 'sub-button-label', options.subButtonLabel);
153
- }
154
- if (this.hasOwnProp(options, 'tagPreset'))
155
- this.setAttr(el, 'tag-preset', options.tagPreset);
156
- if (this.hasOwnProp(options, 'tagLabel'))
157
- this.setAttr(el, 'tag-label', options.tagLabel);
158
- if (this.hasOwnProp(options, 'slotLabel'))
159
- this.setAttr(el, 'slot-label', options.slotLabel);
160
- if (this.hasOwnProp(options, 'topMessage'))
161
- el.topMessage = options.topMessage ?? [];
162
- if (this.hasOwnProp(options, 'bottomMessage'))
163
- el.bottomMessage = options.bottomMessage ?? [];
164
- if (this.hasOwnProp(options, 'tagContents'))
165
- el.tagContents = options.tagContents;
166
- }
167
104
  handleBackdropClick = () => {
168
105
  const top = this.getTopEntry();
169
106
  if (!top)
@@ -172,7 +109,7 @@ const SdModalContainer = class {
172
109
  this.shakeModal(top.modalEl);
173
110
  return;
174
111
  }
175
- this.requestDismiss(top.id, 'cancel');
112
+ this.requestDismiss(top.id, 'close');
176
113
  };
177
114
  shakeModal(modalEl) {
178
115
  const cls = 'sd-modal-container__modal--shake';
@@ -198,7 +135,6 @@ const SdModalContainer = class {
198
135
  if (!entry || entry.closing)
199
136
  return;
200
137
  entry.modalEl.classList.remove('sd-modal-container__modal--visible');
201
- // fade out backdrop simultaneously if this is the last active modal
202
138
  const remainingActive = (this.entries ?? []).filter(item => item.id !== id && !item.closing);
203
139
  if (remainingActive.length === 0) {
204
140
  this.isBackdropVisible = false;
@@ -207,10 +143,18 @@ const SdModalContainer = class {
207
143
  this.finalizeDismiss(id);
208
144
  }, ANIMATION_DURATION);
209
145
  this.entries = (this.entries ?? []).map(item => item.id === id ? { ...item, closing: true, dismissTimerId } : item);
210
- if (reason === 'confirm')
211
- entry.chain._triggerOk();
212
- if (reason === 'cancel')
213
- entry.chain._triggerCancel();
146
+ if (reason === 'close') {
147
+ if (entry.closeAction === 'ok')
148
+ entry.chain._triggerOk();
149
+ else if (entry.closeAction === 'cancel')
150
+ entry.chain._triggerCancel();
151
+ }
152
+ else {
153
+ if (reason === 'confirm')
154
+ entry.chain._triggerOk();
155
+ if (reason === 'cancel')
156
+ entry.chain._triggerCancel();
157
+ }
214
158
  }
215
159
  finalizeDismiss(id) {
216
160
  const entry = (this.entries ?? []).find(item => item.id === id);
@@ -44,18 +44,26 @@ const SdPopover = class {
44
44
  this.slotContent = this.el.innerHTML;
45
45
  }
46
46
  buttonEl;
47
+ get popoverOffset() {
48
+ switch (this.placement) {
49
+ case 'top': return [0, -4];
50
+ case 'bottom': return [0, 4];
51
+ case 'left': return [4, 0];
52
+ case 'right': return [4, 0];
53
+ }
54
+ }
47
55
  handleClose = () => {
48
56
  this.showPopover = false;
49
57
  };
50
58
  render() {
51
- return (index.h(index.Fragment, { key: '205b8f574ce69afcb2abef1b0d0d6ec769230783' }, this.label ? (index.h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-popover", onSdClick: () => (this.showPopover = !this.showPopover) })) : (index.h("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-popover", onClick: () => (this.showPopover = !this.showPopover) })), this.showPopover && (index.h("sd-floating-portal", { key: 'af82589e6ed773709c83a6855c37b1ac7092b9ec', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: this.placement }, index.h("div", { key: 'dfee40fa54b436a43583ebdc71830e6d590e1793', class: {
59
+ return (index.h(index.Fragment, { key: 'f367ea2ada0fda7c28c943bd7bd48785b1810999' }, this.label ? (index.h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-popover", onSdClick: () => (this.showPopover = !this.showPopover) })) : (index.h("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-popover", onClick: () => (this.showPopover = !this.showPopover) })), this.showPopover && (index.h("sd-floating-portal", { key: 'afdb58bfdf25af2adc45a7b81221c1859b517a5a', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: this.placement, offset: this.popoverOffset }, index.h("div", { key: '38757707dd8c055674edbc2381409f5fd8712c8d', class: {
52
60
  'sd-floating-menu': true,
53
61
  'sd-floating-menu--popover': true,
54
62
  [`sd-floating-menu--${this.placement}`]: true,
55
63
  [this.menuClass]: !!this.menuClass,
56
64
  }, style: {
57
65
  '--sd-floating-bg': popoverTokens.popover.bg,
58
- } }, index.h("i", { key: '388ac52f514ddd9247e79d20309a1de029fcd601', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, index.h(tooltipArrow.TooltipArrow, { key: '2502e1a63e3dca7e9c6d66805a9ec04e3106dd99' })), index.h("div", { key: 'e12b0df1dbdfe4b34de81ed231e1578bb5361afa', class: "sd-floating-menu__content" }, this.menuTitle && index.h("div", { key: '91f068beee3338f547157db06a0eee4f5e88355d', class: "sd-floating-menu__title" }, this.menuTitle), this.messages.length > 0 && (index.h("div", { key: '1283a6209c1c062d925ae1c32ba2a4f2aa98c8fa', class: "sd-floating-menu__messages" }, this.messages.map(message => (index.h("div", null, message))))), this.buttons.length > 0 && (index.h("div", { key: '130f5468eb8ac34bb02dce9a5a55c1fad17c8dcf', class: `sd-floating-menu__buttons sd-floating-menu__buttons--${this.buttons.length}` }, this.buttons.map(button => (index.h("sd-button", { ...button })))))), this.useClose && (index.h("button", { key: '330fb79d032bac9da45afec3ccf0f2ec6e3dafba', title: "close", class: "sd-floating-menu__close-button", onClick: () => this.handleClose() }, index.h("sd-icon", { key: '7ba5d1e112ac776bb29253ac2cee510d36147ced', name: "close", size: popoverTokens.popover.close.icon, color: popoverTokens.popover.close.color }))))))));
66
+ } }, index.h("i", { key: '333bae4cb23470121d63d4d8b34a1d2b15837e7d', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, index.h(tooltipArrow.TooltipArrow, { key: '617781bb6fc8957576eb149471fd8bf0f44ca552' })), index.h("div", { key: '8c57d49782edd344c8c2c0b9bf44fff8ec154159', class: "sd-floating-menu__content" }, this.menuTitle && index.h("div", { key: 'a06b93124684cb96910ffa2603cf7410a01d6381', class: "sd-floating-menu__title" }, this.menuTitle), this.messages.length > 0 && (index.h("div", { key: '24691930b8ae03a3c92ed8e74dae708b5e64f03b', class: "sd-floating-menu__messages" }, this.messages.map(message => (index.h("div", null, message))))), this.buttons.length > 0 && (index.h("div", { key: 'd73cd4cc978711857c4c946dd2a1c1b64bb5feb6', class: `sd-floating-menu__buttons sd-floating-menu__buttons--${this.buttons.length}` }, this.buttons.map(button => (index.h("sd-button", { ...button })))))), this.useClose && (index.h("button", { key: 'cda218024d04b03fc2931afa99f0127bc7a9c4c5', title: "close", class: "sd-floating-menu__close-button", onClick: () => this.handleClose() }, index.h("sd-icon", { key: '3f41ebce27fd4bab823370d6bbe25b5caed9d5e1', name: "close", size: popoverTokens.popover.close.icon, color: popoverTokens.popover.close.color }))))))));
59
67
  }
60
68
  static get watchers() { return {
61
69
  "show": [{
@@ -41,10 +41,10 @@ const SdProgress = class {
41
41
  return this.statusColor[this.progressStatus];
42
42
  }
43
43
  render() {
44
- return (index.h("div", { key: '864f669831515b9c149ad579b6233e960eee79a9', style: {
44
+ return (index.h("div", { key: 'b97a1ba0ad800ada8a2e87aab6108a77053a3ed5', style: {
45
45
  '--progress-color': this.progressColor,
46
46
  '--progress-percentage': `${this.progressPercentage}%`,
47
- } }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && index.h("div", { key: '42920cc06b249371ec7d98c07d2185d71265a538', class: "sd-progress__label" }, this.label)));
47
+ } }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && index.h("div", { key: '6a182e4ade2d9c361a85d3fda62f08f62f4722a3', class: "sd-progress__label" }, this.label)));
48
48
  }
49
49
  renderBarProgress() {
50
50
  return (index.h("div", { class: `sd-progress__bar sd-progress__bar--${this.progressStatus}` }, index.h("div", { class: ['sd-progress__bar__percent', this.progressPercentage < 100 ? 'proceed' : ''].join(' ') }), index.h("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--left" }, this.progressPercentage, "%"), index.h("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--right" }, this.progressPercentage, "%")));
@@ -275,7 +275,7 @@ const SdSelectGroup = class extends baseDropdownEvent.BaseDropdownEvent {
275
275
  });
276
276
  }
277
277
  render() {
278
- return (index.h("sd-field", { key: '2ff7d25f8fd9724fead7722757f174610d7c084d', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, addonLabel: this.addonLabel, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), style: { '--field-width': this.width || '200px' } }, index.h("div", { key: '57d0ff569579bb56810891a8e50a89e8b82096ac', class: {
278
+ return (index.h("sd-field", { key: '822acc0b4200ab415646218d0f059b45f348f5ea', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, addonLabel: this.addonLabel, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), style: { '--field-width': this.width || '200px' } }, index.h("div", { key: 'f5a76e913d116469a9d3d9c777d5a3ad62ea42b7', class: {
279
279
  'sd-select-group': true,
280
280
  'sd-select-group--open': this.isOpen,
281
281
  'sd-select-group--disabled': this.disabled,
@@ -155,7 +155,7 @@ const SdSelectMultiple = class extends baseDropdownEvent.BaseDropdownEvent {
155
155
  this.handleOptionSelection(option);
156
156
  };
157
157
  render() {
158
- return (index.h("sd-field", { key: '022f39a42986c29f8cab7f6801a7d2e4bbd5aaa5', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el) }, index.h("div", { key: '93e4dd74f1b0ad76429f37c5fe6a9cffb98697d5', class: {
158
+ return (index.h("sd-field", { key: '315be9fce15876ab835f0a6609657dfc04b4f9cf', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el) }, index.h("div", { key: 'db4754bd0710e217119e02827e9e9db3285a5c74', class: {
159
159
  'sd-select-multiple': true,
160
160
  'sd-select-multiple--open': this.isOpen,
161
161
  'sd-select-multiple--disabled': this.disabled,
@@ -48,7 +48,7 @@ const SdSelectOptionGroup = class {
48
48
  }
49
49
  };
50
50
  render() {
51
- return (index.h("div", { key: '70ab9a558faf068cfc4eb0a5f6a29453ceedc6ec', class: {
51
+ return (index.h("div", { key: '809d58fbd23e57920785835b37f00b66b579a96c', class: {
52
52
  'sd-select__option-group': true,
53
53
  'sd-select__option-group--selected': !!this.isSelected,
54
54
  'sd-select__option-group--disabled': !!this.option.disabled,
@@ -57,10 +57,10 @@ const SdSelectOptionGroup = class {
57
57
  'sd-select__option-group--group': this.option.type === 'group',
58
58
  'sd-select__option-group--subgroup': this.option.type === 'subgroup',
59
59
  'sd-select__option-group--item': this.option.type === 'item',
60
- }, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, index.h("div", { key: 'ca5dc0033231ab204a8688f98453742cdbde7d26', class: "sd-select__option-group__label-wrapper" }, this.useCheckbox && (index.h("sd-checkbox", { key: 'bba6cb9fe649f6eda82ba287f73d0142e02c53c2', value: this.isSelected, disabled: this.option.disabled, onClick: e => {
60
+ }, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, index.h("div", { key: 'f2ff05ee37333111548779d9fe78d0c4b91c9a1e', class: "sd-select__option-group__label-wrapper" }, this.useCheckbox && (index.h("sd-checkbox", { key: '4ca8aaffb38af21f27d429f6c937b1da3374c24a', value: this.isSelected, disabled: this.option.disabled, onClick: e => {
61
61
  e.preventDefault();
62
62
  this.handleClick(this.option, this.isSelected, e);
63
- } })), index.h("span", { key: '7d03c080b7f5b92881389bfec787015a6ac55fa1', class: "sd-select__option-group-label" }, this.option.label), this.useIndicator && this.option.type !== 'item' && (index.h("span", { key: '7066453f92eac7549569db6854e3dc32515d80b9', class: "sd-select__option-group__count-indicator" }, `(${this.countInfo?.selectedCount}/${this.countInfo?.totalCount})`)))));
63
+ } })), index.h("span", { key: 'b4b2943e68b98ce82c32e78a9841aae3be4d8e5f', class: "sd-select__option-group-label" }, this.option.label), this.useIndicator && this.option.type !== 'item' && (index.h("span", { key: '6e1414b3738c43f8bd5d308b57440d34f9e1b7fa', class: "sd-select__option-group__count-indicator" }, `(${this.countInfo?.selectedCount}/${this.countInfo?.totalCount})`)))));
64
64
  }
65
65
  };
66
66
  SdSelectOptionGroup.style = sdSelectOptionGroupCss();
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Qvv0fGgj.js');
4
- var sdSelectV2_config = require('./sd-select-v2.config-DZrPJ6OS.js');
4
+ var sdSelectV2_config = require('./sd-select-v2.config-BJXi4hMP.js');
5
5
 
6
- const sdSelectV2ListItemCss = () => `sd-select-v2-list-item{display:block}sd-select-v2-list-item .sd-select-v2-list-item{display:flex;align-items:center;gap:var(--list-item-gap);padding:var(--list-item-padding-y) var(--list-item-padding-right) var(--list-item-padding-y) var(--list-item-padding-left);font-size:var(--list-item-font-size);line-height:var(--list-item-line-height);font-weight:var(--list-item-font-weight);background:var(--list-item-bg);color:var(--list-item-color);cursor:default;user-select:none}sd-select-v2-list-item .sd-select-v2-list-item--selectable{cursor:pointer}sd-select-v2-list-item .sd-select-v2-list-item--depth1-group{border-top:var(--list-item-border-top);font-weight:700}sd-select-v2-list-item .sd-select-v2-list-item--depth2-group{font-weight:500}sd-select-v2-list-item .sd-select-v2-list-item--selectable:not(.sd-select-v2-list-item--disabled):hover{background:var(--list-item-bg-hover);color:var(--list-item-color-hover)}sd-select-v2-list-item .sd-select-v2-list-item--focused.sd-select-v2-list-item--selectable:not(.sd-select-v2-list-item--disabled){background:var(--list-item-bg-hover);color:var(--list-item-color-hover)}sd-select-v2-list-item .sd-select-v2-list-item--selected:not(.sd-select-v2-list-item--group){font-weight:700;color:var(--list-item-bg-hover)}sd-select-v2-list-item .sd-select-v2-list-item--selected:hover,sd-select-v2-list-item .sd-select-v2-list-item--selected.sd-select-v2-list-item--focused{color:var(--list-item-color-hover)}sd-select-v2-list-item .sd-select-v2-list-item--disabled{color:var(--list-item-color-disabled);cursor:not-allowed}sd-select-v2-list-item .sd-select-v2-list-item__label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}sd-select-v2-list-item .sd-select-v2-list-item__count{flex-shrink:0;font-weight:500;color:var(--list-item-color-disabled)}sd-select-v2-list-item .sd-select-v2-list-item__checkbox{flex-shrink:0}`;
6
+ const sdSelectV2ListItemCss = () => `sd-select-v2-list-item{display:block}sd-select-v2-list-item .sd-select-v2-list-item{display:flex;align-items:center;gap:var(--list-item-gap);padding:var(--list-item-padding-y) var(--list-item-padding-right) var(--list-item-padding-y) var(--list-item-padding-left);font-size:var(--list-item-font-size);line-height:var(--list-item-line-height);font-weight:var(--list-item-font-weight);background:var(--list-item-bg);color:var(--list-item-color);cursor:default;user-select:none}sd-select-v2-list-item .sd-select-v2-list-item--selectable{cursor:pointer}sd-select-v2-list-item .sd-select-v2-list-item--depth1-group{border-top:var(--list-item-border-top);font-weight:700}sd-select-v2-list-item .sd-select-v2-list-item--depth2-group{font-weight:500}sd-select-v2-list-item .sd-select-v2-list-item--focused.sd-select-v2-list-item--selectable:not(.sd-select-v2-list-item--disabled){background:var(--list-item-bg-hover);color:var(--list-item-color-hover)}sd-select-v2-list-item .sd-select-v2-list-item--selected:not(.sd-select-v2-list-item--group){font-weight:700;color:var(--list-item-bg-hover)}sd-select-v2-list-item .sd-select-v2-list-item--selected.sd-select-v2-list-item--focused{color:var(--list-item-color-hover)}sd-select-v2-list-item .sd-select-v2-list-item--disabled{color:var(--list-item-color-disabled);cursor:not-allowed}sd-select-v2-list-item .sd-select-v2-list-item__label{flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}sd-select-v2-list-item .sd-select-v2-list-item__count{flex-shrink:0;font-weight:500;color:var(--list-item-color-disabled)}sd-select-v2-list-item .sd-select-v2-list-item--group.sd-select-v2-list-item--focused .sd-select-v2-list-item__count{color:#ffffff}sd-select-v2-list-item .sd-select-v2-list-item__checkbox{flex-shrink:0}`;
7
7
 
8
8
  const SdSelectV2ListItem = class {
9
9
  constructor(hostRef) {
@@ -73,7 +73,7 @@ const SdSelectV2ListItem = class {
73
73
  if (isDepth1Group) {
74
74
  cssVars['--list-item-border-top'] = `${sdSelectV2_config.LIST_ITEM_COLORS.depth1.borderWidth}px solid ${sdSelectV2_config.LIST_ITEM_COLORS.depth1.border}`;
75
75
  }
76
- return (index.h("div", { key: '1e828b28202b9d22cc02dff0550e37e506167f90', class: {
76
+ return (index.h("div", { key: 'af73e77fdeb673b1862b7bd0b153ee0726a3f5db', class: {
77
77
  'sd-select-v2-list-item': true,
78
78
  'sd-select-v2-list-item--group': isGroup,
79
79
  'sd-select-v2-list-item--depth1-group': isDepth1Group,
@@ -83,7 +83,7 @@ const SdSelectV2ListItem = class {
83
83
  'sd-select-v2-list-item--focused': this.isFocused,
84
84
  'sd-select-v2-list-item--selectable': this.isSelectable && !this.option.disabled,
85
85
  'sd-select-v2-list-item--disabled': !!this.option.disabled,
86
- }, style: cssVars, onClick: this.handleClick }, this.useCheckbox && (index.h("sd-checkbox", { key: '7f49b89aff1a269944551664bc8a51447b5b2f7e', value: this.isSelected === null ? null : !!this.isSelected, disabled: this.option.disabled, class: "sd-select-v2-list-item__checkbox", onClick: this.handleCheckboxClick, onSdUpdate: this.handleCheckboxUpdate })), index.h("span", { key: '51aad2d06ecdf11968f3f13c632081a663a3d200', class: "sd-select-v2-list-item__label" }, this.option.label), this.countInfo && (index.h("span", { key: '1c1f5cd51460863ce41c8980dcc65cd2bb7bfee5', class: "sd-select-v2-list-item__count" }, "(", this.countInfo.selected, "/", this.countInfo.total, ")"))));
86
+ }, style: cssVars, onClick: this.handleClick }, this.useCheckbox && (index.h("sd-checkbox", { key: '8cfcf0375fc756562c4ac698c843bfde3ec3750c', value: this.isSelected === null ? null : !!this.isSelected, disabled: this.option.disabled, class: "sd-select-v2-list-item__checkbox", onClick: this.handleCheckboxClick, onSdUpdate: this.handleCheckboxUpdate })), index.h("span", { key: '1a993c125767559c9cd27f343983b26a24413a93', class: "sd-select-v2-list-item__label" }, this.option.label), this.countInfo && (index.h("span", { key: '377d0d6c6acab983aff2471fc0f4f78eaa637370', class: "sd-select-v2-list-item__count" }, "(", this.countInfo.selected, "/", this.countInfo.total, ")"))));
87
87
  }
88
88
  };
89
89
  SdSelectV2ListItem.style = sdSelectV2ListItemCss();
@@ -121,15 +121,6 @@ const SdSelectV2ListItemSearch = class {
121
121
  this.searchFilter.emit(this.searchText);
122
122
  }, sdSelectV2_config.SEARCH_DEBOUNCE_MS);
123
123
  };
124
- handleKeyDown = (e) => {
125
- if (e.key === 'Enter') {
126
- e.preventDefault();
127
- e.stopPropagation();
128
- if (this.debounceTimer)
129
- clearTimeout(this.debounceTimer);
130
- this.searchFilter.emit(this.searchText);
131
- }
132
- };
133
124
  handleClear = (e) => {
134
125
  e.stopPropagation();
135
126
  this.searchText = '';
@@ -145,12 +136,12 @@ const SdSelectV2ListItemSearch = class {
145
136
  clearTimeout(this.debounceTimer);
146
137
  }
147
138
  render() {
148
- return (index.h("div", { key: 'e7bd315d17d554aa63346f44eb8b2661994b49aa', class: {
139
+ return (index.h("div", { key: '7e0f812a04f8f72e41916aad1c2bd8313dac44c7', class: {
149
140
  'sd-select-v2-list-item-search': true,
150
141
  'sd-select-v2-list-item-search--scrolled': this.isScrolled,
151
- } }, index.h("div", { key: 'ee332050907bc7e9004ff27e3f79cf816e7a44e7', class: "sd-select-v2-list-item-search__inner" }, index.h("sd-icon", { key: 'ccd929d161ba92ef4e8b008cee8866815c21f430', name: "search", size: 16, color: "grey_70", class: "sd-select-v2-list-item-search__icon" }), index.h("input", { key: 'b10e1dcf4bee6df78e917c9e4c31563e0466f38e', ref: el => {
142
+ } }, index.h("div", { key: 'f9df679b4cab727ba2c29293194556dad00bf46b', class: "sd-select-v2-list-item-search__inner" }, index.h("sd-icon", { key: '5f9eb6de82437a6344cc3a0042a24196cb7392a5', name: "search", size: 16, color: "grey_70", class: "sd-select-v2-list-item-search__icon" }), index.h("input", { key: '382b15077dd49e3addceca6026953c6065a5f60c', ref: el => {
152
143
  this.inputEl = el;
153
- }, type: "text", class: "sd-select-v2-list-item-search__input", placeholder: "\uAC80\uC0C9\uC5B4 \uC785\uB825", value: this.searchText, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: () => this.searchFocus.emit() }), this.searchText && (index.h("button", { key: 'fa2ee3033cff6b707a409ada6982ed596492c81d', type: "button", class: "sd-select-v2-list-item-search__clear", onClick: this.handleClear }, index.h("sd-icon", { key: '0e2cab7ca1a11c1ce60e74ac435dc55fbc375438', name: "close", size: 12, color: "#888888" }))))));
144
+ }, type: "text", class: "sd-select-v2-list-item-search__input", placeholder: "\uAC80\uC0C9\uC5B4 \uC785\uB825", value: this.searchText, onInput: this.handleInput, onFocus: () => this.searchFocus.emit() }), this.searchText && (index.h("button", { key: '00830db3b8d303993acf0787e3818e36f7c2c19c', type: "button", class: "sd-select-v2-list-item-search__clear", onClick: this.handleClear }, index.h("sd-icon", { key: 'a40a022ec7a3ea9d4bda28e7b5fd41850966c716', name: "close", size: 12, color: "#888888" }))))));
154
145
  }
155
146
  };
156
147
  SdSelectV2ListItemSearch.style = sdSelectV2ListItemSearchCss();
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Qvv0fGgj.js');
4
- var sdSelectV2_config = require('./sd-select-v2.config-DZrPJ6OS.js');
4
+ var sdSelectV2_config = require('./sd-select-v2.config-BJXi4hMP.js');
5
5
 
6
- const sdSelectV2ListboxCss = () => `sd-select-v2-listbox{display:block}sd-select-v2-listbox .sd-select-v2-listbox{display:flex;flex-direction:column;min-width:var(--listbox-trigger-width);max-width:var(--listbox-max-width);max-height:var(--listbox-max-height);width:fit-content;border-radius:var(--listbox-radius);background:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);overflow:hidden}sd-select-v2-listbox .sd-select-v2-listbox__list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--listbox-padding-bottom)}sd-select-v2-listbox .sd-select-v2-listbox__empty{padding:12px;text-align:center;font-size:12px;line-height:20px;color:#888888}`;
6
+ const sdSelectV2ListboxCss = () => `sd-select-v2-listbox{display:block}sd-select-v2-listbox .sd-select-v2-listbox{display:flex;flex-direction:column;min-width:var(--listbox-trigger-width);max-width:var(--listbox-max-width);max-height:var(--listbox-max-height);width:fit-content;border-radius:var(--listbox-radius);background:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);overflow:hidden;outline:none}sd-select-v2-listbox .sd-select-v2-listbox__list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--listbox-padding-bottom)}sd-select-v2-listbox .sd-select-v2-listbox__empty{padding:12px;text-align:center;font-size:12px;line-height:20px;color:#888888}`;
7
7
 
8
8
  const SdSelectV2Listbox = class {
9
9
  constructor(hostRef) {
@@ -19,7 +19,12 @@ const SdSelectV2Listbox = class {
19
19
  maxHeight = '260px';
20
20
  searchKeyword = '';
21
21
  isScrolled = false;
22
+ focusedIndex = -1;
22
23
  optionSelect;
24
+ listEl;
25
+ lastScrolledIndex = -1;
26
+ keydownAttached = false;
27
+ suppressHover = false;
23
28
  get isDepth() {
24
29
  return this.name === 'default_depth' || this.name === 'multi_depth';
25
30
  }
@@ -69,9 +74,9 @@ const SdSelectV2Listbox = class {
69
74
  const selectedValues = this.getSelectedValues();
70
75
  if (selectedValues.size === 0)
71
76
  return false;
72
- const originalOption = this.findOriginalOption(option.value, this.options);
73
- const targetOption = originalOption ?? option;
74
- const leaves = this.collectLeaves(targetOption);
77
+ const leaves = this.collectVisibleLeaves(option);
78
+ if (leaves.length === 0)
79
+ return false;
75
80
  const selectedCount = leaves.filter(l => selectedValues.has(l.value)).length;
76
81
  if (selectedCount === 0)
77
82
  return false;
@@ -83,10 +88,9 @@ const SdSelectV2Listbox = class {
83
88
  if (!this.isMulti || !option.children)
84
89
  return undefined;
85
90
  const selectedValues = this.getSelectedValues();
86
- const originalOption = this.findOriginalOption(option.value, this.options);
87
- const totalLeaves = originalOption ? this.collectLeaves(originalOption) : this.collectLeaves(option);
88
- const selectedCount = totalLeaves.filter(l => selectedValues.has(l.value)).length;
89
- return { selected: selectedCount, total: totalLeaves.length };
91
+ const leaves = this.collectVisibleLeaves(option);
92
+ const selectedCount = leaves.filter(l => selectedValues.has(l.value)).length;
93
+ return { selected: selectedCount, total: leaves.length };
90
94
  }
91
95
  findOriginalOption(value, options) {
92
96
  for (const opt of options) {
@@ -105,21 +109,177 @@ const SdSelectV2Listbox = class {
105
109
  return [option];
106
110
  return option.children.flatMap(child => this.collectLeaves(child));
107
111
  }
112
+ /**
113
+ * Returns the leaves currently visible to the user for the given (possibly
114
+ * filtered) option. When a group's own label matched the search keyword its
115
+ * `children` is emptied by `filterTree`; in that case we fall back to the
116
+ * full original subtree because the user has no way to deselect descendants
117
+ * individually.
118
+ */
119
+ collectVisibleLeaves(option) {
120
+ if (!option.children)
121
+ return [option];
122
+ if (option.children.length === 0) {
123
+ const original = this.findOriginalOption(option.value, this.options);
124
+ return original ? this.collectLeaves(original) : [];
125
+ }
126
+ return option.children.flatMap(child => this.collectVisibleLeaves(child));
127
+ }
128
+ get navigableOptions() {
129
+ const items = [];
130
+ const walk = (opts) => {
131
+ for (const opt of opts) {
132
+ const isGroup = !!opt.children;
133
+ const isSelectable = !isGroup || this.isMulti;
134
+ if (isSelectable && !opt.disabled)
135
+ items.push(opt);
136
+ if (isGroup && opt.children && opt.children.length > 0)
137
+ walk(opt.children);
138
+ }
139
+ };
140
+ walk(this.filteredOptions);
141
+ return items;
142
+ }
143
+ isOptionFocused(option) {
144
+ if (this.focusedIndex < 0)
145
+ return false;
146
+ const focused = this.navigableOptions[this.focusedIndex];
147
+ // filterTree 가 매 호출마다 옵션 객체를 새로 복제하기 때문에 참조 비교
148
+ // (=== / indexOf) 는 검색이 적용된 동안 항상 실패한다. 고유 식별자인
149
+ // value 로 비교해야 한다.
150
+ return !!focused && focused.value === option.value;
151
+ }
152
+ resetFocusOnFilter() {
153
+ // 필터가 바뀌면 이전 인덱스가 가리키던 항목이 사라질 수 있으므로
154
+ // 새 결과의 첫 항목으로 옮긴다. 결과가 비면 -1.
155
+ const items = this.navigableOptions;
156
+ this.focusedIndex = items.length > 0 ? 0 : -1;
157
+ // 키보드 네비게이션 직후 마우스가 한 번도 안 움직인 채로 사용자가
158
+ // 검색을 시작했다면 hover suppression 이 켜진 상태로 남아있을 수 있다.
159
+ // 검색이라는 명백한 사용자 의도 전환 시점에 강제로 해제한다.
160
+ if (this.suppressHover) {
161
+ document.removeEventListener('mousemove', this.releaseHoverSuppress, true);
162
+ this.suppressHover = false;
163
+ }
164
+ }
108
165
  handleSearchFilter = (e) => {
109
166
  this.searchKeyword = e.detail;
110
167
  };
111
168
  handleScroll = (e) => {
112
169
  this.isScrolled = e.target.scrollTop > 0;
113
170
  };
171
+ emitOptionSelect(option) {
172
+ this.optionSelect.emit({
173
+ option,
174
+ leaves: this.collectVisibleLeaves(option),
175
+ });
176
+ }
114
177
  handleOptionClick = (e) => {
115
178
  e.stopPropagation();
116
- this.optionSelect.emit(e.detail);
179
+ this.emitOptionSelect(e.detail);
180
+ };
181
+ handleOptionHover = (option) => {
182
+ if (this.suppressHover)
183
+ return;
184
+ const idx = this.navigableOptions.findIndex(o => o.value === option.value);
185
+ if (idx >= 0)
186
+ this.focusedIndex = idx;
187
+ };
188
+ releaseHoverSuppress = () => {
189
+ this.suppressHover = false;
190
+ document.removeEventListener('mousemove', this.releaseHoverSuppress, true);
117
191
  };
192
+ handleKeyDown = (e) => {
193
+ const items = this.navigableOptions;
194
+ if (e.key === 'ArrowDown') {
195
+ if (items.length === 0)
196
+ return;
197
+ e.preventDefault();
198
+ e.stopPropagation();
199
+ this.focusedIndex = this.focusedIndex < 0 ? 0 : (this.focusedIndex + 1) % items.length;
200
+ this.beginHoverSuppression();
201
+ }
202
+ else if (e.key === 'ArrowUp') {
203
+ if (items.length === 0)
204
+ return;
205
+ e.preventDefault();
206
+ e.stopPropagation();
207
+ this.focusedIndex = this.focusedIndex <= 0 ? items.length - 1 : this.focusedIndex - 1;
208
+ this.beginHoverSuppression();
209
+ }
210
+ else if (e.key === 'Enter') {
211
+ if (this.focusedIndex < 0 || this.focusedIndex >= items.length)
212
+ return;
213
+ e.preventDefault();
214
+ e.stopPropagation();
215
+ this.emitOptionSelect(items[this.focusedIndex]);
216
+ }
217
+ };
218
+ /**
219
+ * 키보드로 인덱스를 옮기면 자동 스크롤이 일어나는데, 정지한 마우스 커서
220
+ * 아래로 다른 항목이 미끄러져 들어오면서 mouseenter 가 발화해 인덱스를
221
+ * 다시 덮어쓰는 문제를 막는다. 실제로 마우스가 한 번이라도 움직이기 전까지
222
+ * hover 갱신을 무시한다.
223
+ */
224
+ beginHoverSuppression() {
225
+ if (this.suppressHover)
226
+ return;
227
+ this.suppressHover = true;
228
+ document.addEventListener('mousemove', this.releaseHoverSuppress, true);
229
+ }
230
+ /**
231
+ * 리스트 컨테이너 내부에서만 스크롤한다. `scrollIntoView` 는 조상 스크롤
232
+ * 컨테이너(=문서 자체)까지 함께 스크롤시키므로 사용하지 않는다.
233
+ */
234
+ scrollFocusedIntoView() {
235
+ const list = this.listEl;
236
+ const focusedEl = list?.querySelector('.sd-select-v2-list-item--focused');
237
+ if (!list || !focusedEl)
238
+ return;
239
+ const listRect = list.getBoundingClientRect();
240
+ const itemRect = focusedEl.getBoundingClientRect();
241
+ if (itemRect.top < listRect.top) {
242
+ list.scrollTop += itemRect.top - listRect.top;
243
+ }
244
+ else if (itemRect.bottom > listRect.bottom) {
245
+ list.scrollTop += itemRect.bottom - listRect.bottom;
246
+ }
247
+ }
248
+ /**
249
+ * sd-portal 이 슬롯 노드를 body 로 이동시키면서 disconnect → connect 가
250
+ * 발생하므로, 키보드 리스너는 한 번만 실행되는 componentDidLoad 가 아니라
251
+ * connectedCallback / disconnectedCallback 에 묶어 매번 재부착한다.
252
+ * capture phase 로 잡아 포커스가 검색 input 에 있어도 ↑/↓/Enter 가
253
+ * input 의 기본 동작(커서 이동)·페이지 스크롤보다 먼저 처리되도록 한다.
254
+ */
255
+ connectedCallback() {
256
+ if (!this.keydownAttached) {
257
+ document.addEventListener('keydown', this.handleKeyDown, true);
258
+ this.keydownAttached = true;
259
+ }
260
+ }
261
+ disconnectedCallback() {
262
+ if (this.keydownAttached) {
263
+ document.removeEventListener('keydown', this.handleKeyDown, true);
264
+ this.keydownAttached = false;
265
+ }
266
+ if (this.suppressHover) {
267
+ document.removeEventListener('mousemove', this.releaseHoverSuppress, true);
268
+ this.suppressHover = false;
269
+ }
270
+ }
271
+ componentDidRender() {
272
+ if (this.focusedIndex !== this.lastScrolledIndex) {
273
+ this.lastScrolledIndex = this.focusedIndex;
274
+ if (this.focusedIndex >= 0)
275
+ this.scrollFocusedIntoView();
276
+ }
277
+ }
118
278
  renderOptions(options, depth = 1) {
119
279
  return options.map(option => {
120
280
  const isGroup = !!option.children;
121
281
  return [
122
- index.h("sd-select-v2-list-item", { option: option, depth: depth, isSelected: isGroup ? this.getGroupSelectionState(option) : this.isOptionSelected(option), useCheckbox: this.isMulti, countInfo: this.getCountInfo(option), onSdListItemClick: this.handleOptionClick }),
282
+ index.h("sd-select-v2-list-item", { option: option, depth: depth, isSelected: isGroup ? this.getGroupSelectionState(option) : this.isOptionSelected(option), isFocused: this.isOptionFocused(option), useCheckbox: this.isMulti, countInfo: this.getCountInfo(option), onSdListItemClick: this.handleOptionClick, onMouseEnter: () => this.handleOptionHover(option) }),
123
283
  isGroup && option.children ? this.renderOptions(option.children, depth + 1) : null,
124
284
  ];
125
285
  });
@@ -132,8 +292,15 @@ const SdSelectV2Listbox = class {
132
292
  '--listbox-radius': `${sdSelectV2_config.LIST_BOX_LAYOUT.radius}px`,
133
293
  '--listbox-padding-bottom': `${sdSelectV2_config.LIST_BOX_LAYOUT.paddingBottom}px`,
134
294
  };
135
- return (index.h("div", { key: 'b64bc66e7f9a356e3f0cf752cba3a3c9de1928c5', class: "sd-select-v2-listbox", style: cssVars }, this.showSearch && (index.h("sd-select-v2-list-item-search", { key: '2444bdda4e2a83008d175ba9867ecad01da5ed25', isScrolled: this.isScrolled, onSdSearchFilter: this.handleSearchFilter })), index.h("div", { key: '6307a0fd5480c006248dee44c4e1b54dd5749895', class: "sd-select-v2-listbox__list", onScroll: this.handleScroll }, this.isEmpty ? (index.h("div", { class: "sd-select-v2-listbox__empty" }, sdSelectV2_config.EMPTY_MESSAGE)) : this.isDepth ? (this.renderOptions(this.filteredOptions)) : (this.filteredOptions.map(option => (index.h("sd-select-v2-list-item", { option: option, depth: 1, isSelected: this.isOptionSelected(option), useCheckbox: this.isMulti, onSdListItemClick: this.handleOptionClick })))))));
295
+ return (index.h("div", { key: 'f47839574d0c149ab4aa2a3912b51318ec815b55', class: "sd-select-v2-listbox", style: cssVars }, this.showSearch && (index.h("sd-select-v2-list-item-search", { key: '3c3f9fd3e0c935da59bc7727af5c719b76b309d5', isScrolled: this.isScrolled, onSdSearchFilter: this.handleSearchFilter })), index.h("div", { key: '4d4ef6c7c543689abb9ed085e07e613deca6c8d8', class: "sd-select-v2-listbox__list", onScroll: this.handleScroll, ref: el => {
296
+ this.listEl = el;
297
+ } }, this.isEmpty ? (index.h("div", { class: "sd-select-v2-listbox__empty" }, sdSelectV2_config.EMPTY_MESSAGE)) : this.isDepth ? (this.renderOptions(this.filteredOptions)) : (this.filteredOptions.map(option => (index.h("sd-select-v2-list-item", { option: option, depth: 1, isSelected: this.isOptionSelected(option), isFocused: this.isOptionFocused(option), useCheckbox: this.isMulti, onSdListItemClick: this.handleOptionClick, onMouseEnter: () => this.handleOptionHover(option) })))))));
136
298
  }
299
+ static get watchers() { return {
300
+ "searchKeyword": [{
301
+ "resetFocusOnFilter": 0
302
+ }]
303
+ }; }
137
304
  };
138
305
  SdSelectV2Listbox.style = sdSelectV2ListboxCss();
139
306
 
@@ -169,11 +336,11 @@ const SdSelectV2Trigger = class {
169
336
  : sdSelectV2_config.SELECT_COLORS.icon.default,
170
337
  '--trigger-icon-color': this.disabled ? sdSelectV2_config.SELECT_COLORS.icon.disabled : sdSelectV2_config.SELECT_COLORS.icon.default,
171
338
  };
172
- return (index.h("div", { key: '4fe2634aee7071ed48348b19dc367b1af88fd6d9', class: {
339
+ return (index.h("div", { key: '2cf4cc98bbfc8808f84d1d6b9dbfbb4f1afee272', class: {
173
340
  'sd-select-v2-trigger': true,
174
341
  'sd-select-v2-trigger--open': this.isOpen,
175
342
  'sd-select-v2-trigger--disabled': this.disabled,
176
- }, style: cssVars, onClick: this.handleClick }, index.h("div", { key: 'e0f71cdd91c6e04ebe5543fb2bc87d7331735da6', class: "sd-select-v2-trigger__content" }, index.h("span", { key: '3abfbc0541569c68870addc16a7d3439d7189ab5', class: "sd-select-v2-trigger__text" }, hasValue ? this.displayText : this.placeholder), index.h("sd-icon", { key: '8fcb187f67be75cf03c0f0bde42121cba0b16a47', name: "arrowDown", size: 12, color: "var(--trigger-icon-color)", class: {
343
+ }, style: cssVars, onClick: this.handleClick }, index.h("div", { key: '8835de30555a7ef7846afacad8ec6ee5482b36cf', class: "sd-select-v2-trigger__content" }, index.h("span", { key: '5afd6845dc9b412a3cd87e6a16de8bd506b38dbb', class: "sd-select-v2-trigger__text" }, hasValue ? this.displayText : this.placeholder), index.h("sd-icon", { key: '727d44f2814321bc80ca5a9d127ce5676f0bfdc6', name: "arrowDown", size: 12, color: "var(--trigger-icon-color)", class: {
177
344
  'sd-select-v2-trigger__icon': true,
178
345
  'sd-select-v2-trigger__icon--open': this.isOpen,
179
346
  } }))));