@sapudex/web-components 2.20.1 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/bundle.esm.js +4 -0
  2. package/cypress/specs/Feed.cy.tsx +72 -0
  3. package/cypress/specs/FeedItem.cy.tsx +82 -0
  4. package/cypress/specs/Footer.cy.tsx +45 -1
  5. package/cypress/specs/ImageGridCloud.cy.tsx +78 -0
  6. package/cypress/specs/ImageGridCloudItem.cy.tsx +29 -0
  7. package/cypress/support/component-imports.instrumented.ts +8 -0
  8. package/cypress/support/component-imports.src.ts +8 -0
  9. package/dist/Accordion.js +1 -0
  10. package/dist/Accordion.js.map +1 -1
  11. package/dist/AccordionItem.js +2 -0
  12. package/dist/AccordionItem.js.map +1 -1
  13. package/dist/AssetsVariables.js +5 -0
  14. package/dist/AssetsVariables.js.map +1 -1
  15. package/dist/Breadcrumbs.js +5 -0
  16. package/dist/Breadcrumbs.js.map +1 -1
  17. package/dist/ContactItem.js +2 -0
  18. package/dist/ContactItem.js.map +1 -1
  19. package/dist/CountrySelector.js +1 -0
  20. package/dist/CountrySelector.js.map +1 -1
  21. package/dist/DatePicker.js +2 -1
  22. package/dist/DatePicker.js.map +1 -1
  23. package/dist/Feed.d.ts +88 -0
  24. package/dist/Feed.js +103 -0
  25. package/dist/Feed.js.map +1 -0
  26. package/dist/FeedItem.d.ts +114 -0
  27. package/dist/FeedItem.js +131 -0
  28. package/dist/FeedItem.js.map +1 -0
  29. package/dist/FeedItemTemplate.d.ts +2 -0
  30. package/dist/FeedItemTemplate.js +16 -0
  31. package/dist/FeedItemTemplate.js.map +1 -0
  32. package/dist/FeedTemplate.d.ts +2 -0
  33. package/dist/FeedTemplate.js +19 -0
  34. package/dist/FeedTemplate.js.map +1 -0
  35. package/dist/FilterMenu.js +2 -0
  36. package/dist/FilterMenu.js.map +1 -1
  37. package/dist/Footer.d.ts +14 -2
  38. package/dist/Footer.js +37 -4
  39. package/dist/Footer.js.map +1 -1
  40. package/dist/FooterTemplate.js +3 -3
  41. package/dist/FooterTemplate.js.map +1 -1
  42. package/dist/ImageGridCloud.d.ts +76 -0
  43. package/dist/ImageGridCloud.js +153 -0
  44. package/dist/ImageGridCloud.js.map +1 -0
  45. package/dist/ImageGridCloudItem.d.ts +35 -0
  46. package/dist/ImageGridCloudItem.js +49 -0
  47. package/dist/ImageGridCloudItem.js.map +1 -0
  48. package/dist/ImageGridCloudItemTemplate.d.ts +2 -0
  49. package/dist/ImageGridCloudItemTemplate.js +5 -0
  50. package/dist/ImageGridCloudItemTemplate.js.map +1 -0
  51. package/dist/ImageGridCloudTemplate.d.ts +2 -0
  52. package/dist/ImageGridCloudTemplate.js +6 -0
  53. package/dist/ImageGridCloudTemplate.js.map +1 -0
  54. package/dist/ImageGridTicker.d.ts +2 -2
  55. package/dist/ImageGridTicker.js +1 -8
  56. package/dist/ImageGridTicker.js.map +1 -1
  57. package/dist/LinkListItem.js +1 -0
  58. package/dist/LinkListItem.js.map +1 -1
  59. package/dist/List.js +3 -0
  60. package/dist/List.js.map +1 -1
  61. package/dist/ListGroupHeader.js +1 -0
  62. package/dist/ListGroupHeader.js.map +1 -1
  63. package/dist/ListItem.js +2 -0
  64. package/dist/ListItem.js.map +1 -1
  65. package/dist/ListItemBase.js +4 -0
  66. package/dist/ListItemBase.js.map +1 -1
  67. package/dist/ListSelectAll.js +1 -0
  68. package/dist/ListSelectAll.js.map +1 -1
  69. package/dist/MastheadCountrySelector.js +15 -0
  70. package/dist/MastheadCountrySelector.js.map +1 -1
  71. package/dist/MastheadItem.js +10 -0
  72. package/dist/MastheadItem.js.map +1 -1
  73. package/dist/MastheadMenu.js +6 -0
  74. package/dist/MastheadMenu.js.map +1 -1
  75. package/dist/MastheadMobileMenu.js +11 -0
  76. package/dist/MastheadMobileMenu.js.map +1 -1
  77. package/dist/MastheadProfileMenu.js +11 -0
  78. package/dist/MastheadProfileMenu.js.map +1 -1
  79. package/dist/MastheadShell.js +41 -0
  80. package/dist/MastheadShell.js.map +1 -1
  81. package/dist/MediaPlayer.js +1 -0
  82. package/dist/MediaPlayer.js.map +1 -1
  83. package/dist/MediaPlayerVimeo.d.ts +3 -3
  84. package/dist/MediaPlayerVimeo.js +1 -0
  85. package/dist/MediaPlayerVimeo.js.map +1 -1
  86. package/dist/MediaPlayerYoutube.js +3 -0
  87. package/dist/MediaPlayerYoutube.js.map +1 -1
  88. package/dist/Pagination.js +1 -1
  89. package/dist/Pagination.js.map +1 -1
  90. package/dist/Search.d.ts +2 -1
  91. package/dist/Search.js +18 -3
  92. package/dist/Search.js.map +1 -1
  93. package/dist/SearchTemplate.d.ts +2 -0
  94. package/dist/SearchTemplate.js +48 -0
  95. package/dist/SearchTemplate.js.map +1 -0
  96. package/dist/SearchableListBase.d.ts +3 -0
  97. package/dist/SearchableListBase.js +10 -0
  98. package/dist/SearchableListBase.js.map +1 -1
  99. package/dist/SecondaryNavigation.js +19 -0
  100. package/dist/SecondaryNavigation.js.map +1 -1
  101. package/dist/SecondaryNavigationItem.js +6 -0
  102. package/dist/SecondaryNavigationItem.js.map +1 -1
  103. package/dist/SecondaryNavigationSubItem.js +3 -0
  104. package/dist/SecondaryNavigationSubItem.js.map +1 -1
  105. package/dist/SelectBox.js +1 -0
  106. package/dist/SelectBox.js.map +1 -1
  107. package/dist/SocialMediaButton.js +2 -0
  108. package/dist/SocialMediaButton.js.map +1 -1
  109. package/dist/StepInput.js +2 -0
  110. package/dist/StepInput.js.map +1 -1
  111. package/dist/TabNavigation.js +3 -0
  112. package/dist/TabNavigation.js.map +1 -1
  113. package/dist/Tag.js +1 -0
  114. package/dist/Tag.js.map +1 -1
  115. package/dist/TagGroup.js +3 -0
  116. package/dist/TagGroup.js.map +1 -1
  117. package/dist/TextField.js +1 -0
  118. package/dist/TextField.js.map +1 -1
  119. package/dist/Tile.js +1 -0
  120. package/dist/Tile.js.map +1 -1
  121. package/dist/Upload.js +5 -0
  122. package/dist/Upload.js.map +1 -1
  123. package/dist/assets/{InputSuggestions-yR1p8cXL.js → InputSuggestions-By00xQan.js} +1 -1
  124. package/dist/assets/{ListItemStandardExpandableTextTemplate-BovnAV24.js → ListItemStandardExpandableTextTemplate-BGtoxRbA.js} +1 -1
  125. package/dist/assets/{bundle.esm-C7AybWk0.js → bundle.esm-9yDdQqR5.js} +223 -214
  126. package/dist/assets/messagebundle_en-D_yCmNrd.js +1 -0
  127. package/dist/css/themes/Feed.css +1 -0
  128. package/dist/css/themes/FeedItem.css +1 -0
  129. package/dist/css/themes/Footer.css +1 -1
  130. package/dist/css/themes/ImageGridCloud.css +1 -0
  131. package/dist/css/themes/ImageGridCloudItem.css +1 -0
  132. package/dist/css/themes/MediaPlayer.css +1 -1
  133. package/dist/css/themes/Pagination.css +1 -1
  134. package/dist/css/themes/RatingIndicator.css +1 -1
  135. package/dist/css/themes/Slider.css +1 -1
  136. package/dist/custom-elements-internal.json +4455 -456
  137. package/dist/custom-elements.json +1411 -288
  138. package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
  139. package/dist/generated/i18n/i18n-defaults.d.ts +2 -1
  140. package/dist/generated/i18n/i18n-defaults.js +2 -1
  141. package/dist/generated/i18n/i18n-defaults.js.map +1 -1
  142. package/dist/generated/themes/Feed.css.d.ts +2 -0
  143. package/dist/generated/themes/Feed.css.js +8 -0
  144. package/dist/generated/themes/Feed.css.js.map +1 -0
  145. package/dist/generated/themes/FeedItem.css.d.ts +2 -0
  146. package/dist/generated/themes/FeedItem.css.js +8 -0
  147. package/dist/generated/themes/FeedItem.css.js.map +1 -0
  148. package/dist/generated/themes/Footer.css.d.ts +1 -1
  149. package/dist/generated/themes/Footer.css.js +1 -1
  150. package/dist/generated/themes/Footer.css.js.map +1 -1
  151. package/dist/generated/themes/ImageGridCloud.css.d.ts +2 -0
  152. package/dist/generated/themes/ImageGridCloud.css.js +8 -0
  153. package/dist/generated/themes/ImageGridCloud.css.js.map +1 -0
  154. package/dist/generated/themes/ImageGridCloudItem.css.d.ts +2 -0
  155. package/dist/generated/themes/ImageGridCloudItem.css.js +8 -0
  156. package/dist/generated/themes/ImageGridCloudItem.css.js.map +1 -0
  157. package/dist/generated/themes/MediaPlayer.css.d.ts +1 -1
  158. package/dist/generated/themes/MediaPlayer.css.js +1 -1
  159. package/dist/generated/themes/MediaPlayer.css.js.map +1 -1
  160. package/dist/generated/themes/Pagination.css.d.ts +1 -1
  161. package/dist/generated/themes/Pagination.css.js +1 -1
  162. package/dist/generated/themes/Pagination.css.js.map +1 -1
  163. package/dist/generated/themes/RatingIndicator.css.d.ts +1 -1
  164. package/dist/generated/themes/RatingIndicator.css.js +1 -1
  165. package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
  166. package/dist/generated/themes/Slider.css.d.ts +1 -1
  167. package/dist/generated/themes/Slider.css.js +1 -1
  168. package/dist/generated/themes/Slider.css.js.map +1 -1
  169. package/dist/messagebundle.properties +3 -0
  170. package/dist/messagebundle_en.properties +1 -0
  171. package/dist/vscode.html-custom-data.json +130 -1
  172. package/dist/web-types.json +305 -4
  173. package/package.json +1 -1
  174. package/src/Accordion.ts +1 -0
  175. package/src/AccordionItem.ts +2 -0
  176. package/src/AssetsVariables.ts +5 -0
  177. package/src/Breadcrumbs.ts +5 -0
  178. package/src/ContactItem.ts +2 -0
  179. package/src/CountrySelector.ts +1 -0
  180. package/src/DatePicker.ts +2 -1
  181. package/src/Feed.ts +144 -0
  182. package/src/FeedItem.ts +198 -0
  183. package/src/FeedItemTemplate.tsx +60 -0
  184. package/src/FeedTemplate.tsx +66 -0
  185. package/src/FilterMenu.ts +2 -0
  186. package/src/Footer.ts +47 -4
  187. package/src/FooterTemplate.tsx +29 -39
  188. package/src/ImageGridCloud.ts +188 -0
  189. package/src/ImageGridCloudItem.ts +57 -0
  190. package/src/ImageGridCloudItemTemplate.tsx +11 -0
  191. package/src/ImageGridCloudTemplate.tsx +16 -0
  192. package/src/ImageGridTicker.ts +3 -3
  193. package/src/LinkListItem.ts +1 -0
  194. package/src/List.ts +3 -0
  195. package/src/ListGroupHeader.ts +1 -0
  196. package/src/ListItem.ts +2 -0
  197. package/src/ListItemBase.ts +4 -0
  198. package/src/ListSelectAll.ts +1 -0
  199. package/src/MastheadCountrySelector.ts +15 -0
  200. package/src/MastheadItem.ts +10 -0
  201. package/src/MastheadMenu.ts +6 -0
  202. package/src/MastheadMobileMenu.ts +11 -0
  203. package/src/MastheadProfileMenu.ts +11 -0
  204. package/src/MastheadShell.ts +41 -0
  205. package/src/MediaPlayer.ts +1 -0
  206. package/src/MediaPlayerVimeo.ts +4 -3
  207. package/src/MediaPlayerYoutube.ts +3 -0
  208. package/src/Pagination.ts +1 -1
  209. package/src/Search.ts +20 -4
  210. package/src/SearchTemplate.tsx +353 -0
  211. package/src/SearchableListBase.ts +10 -0
  212. package/src/SecondaryNavigation.ts +19 -0
  213. package/src/SecondaryNavigationItem.ts +6 -0
  214. package/src/SecondaryNavigationSubItem.ts +3 -0
  215. package/src/SelectBox.ts +1 -0
  216. package/src/SocialMediaButton.ts +2 -0
  217. package/src/StepInput.ts +2 -0
  218. package/src/TabNavigation.ts +3 -0
  219. package/src/Tag.ts +1 -0
  220. package/src/TagGroup.ts +3 -0
  221. package/src/TextField.ts +1 -0
  222. package/src/Tile.ts +1 -0
  223. package/src/Upload.ts +5 -0
  224. package/src/generated/i18n/i18n-defaults.ts +2 -2
  225. package/src/generated/themes/Feed.css.ts +9 -0
  226. package/src/generated/themes/FeedItem.css.ts +9 -0
  227. package/src/generated/themes/Footer.css.ts +1 -1
  228. package/src/generated/themes/ImageGridCloud.css.ts +9 -0
  229. package/src/generated/themes/ImageGridCloudItem.css.ts +9 -0
  230. package/src/generated/themes/MediaPlayer.css.ts +1 -1
  231. package/src/generated/themes/Pagination.css.ts +1 -1
  232. package/src/generated/themes/RatingIndicator.css.ts +1 -1
  233. package/src/generated/themes/Slider.css.ts +1 -1
  234. package/src/i18n/messagebundle.properties +3 -0
  235. package/src/i18n/messagebundle_en.properties +1 -0
  236. package/src/themes/Feed.css +51 -0
  237. package/src/themes/FeedItem.css +60 -0
  238. package/src/themes/Footer.css +9 -5
  239. package/src/themes/ImageGridCloud.css +55 -0
  240. package/src/themes/ImageGridCloudItem.css +10 -0
  241. package/src/themes/MediaPlayer.css +1 -1
  242. package/src/themes/Pagination.css +1 -1
  243. package/dist/assets/messagebundle_en-BhTYnZbC.js +0 -1
  244. package/dist/generated/templates/SearchSuggestionsTemplate.lit.d.ts +0 -3
  245. package/dist/generated/templates/SearchSuggestionsTemplate.lit.js +0 -17
  246. package/dist/generated/templates/SearchSuggestionsTemplate.lit.js.map +0 -1
  247. package/dist/generated/templates/SearchTemplate.lit.d.ts +0 -3
  248. package/dist/generated/templates/SearchTemplate.lit.js +0 -28
  249. package/dist/generated/templates/SearchTemplate.lit.js.map +0 -1
  250. package/src/Search.hbs +0 -155
  251. package/src/SearchSuggestions.hbs +0 -91
  252. package/src/generated/templates/SearchSuggestionsTemplate.lit.ts +0 -21
  253. package/src/generated/templates/SearchTemplate.lit.ts +0 -32
@@ -1 +1 @@
1
- {"version":3,"file":"Upload.js","sourceRoot":"","sources":["../src/Upload.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAElE,OAAO,aAAa,MAAM,wDAAwD,CAAC;AACnF,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,YAAY,MAAM,yCAAyC,CAAC;AAEnE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OA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AI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;yCACb;AAS9B;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAC+B;AAGnD;IADN,IAAI,CAAC,yBAAyB,CAAC;oCACF;AA7G1B,UAAU;IA3Cf,aAAa,CAAC;QACb,GAAG,EAAE,aAAa;QAClB,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,cAAc;QACxB,YAAY,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,CAAC;KACnE,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,kBAAkB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE7C;;;;OAIG;;IACF,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAExC;;;;OAIG;;IACF,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAExC;;;;OAIG;;IACF,KAAK,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE3C;;;;OAIG;;IACF,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAE7B,UAAU,CAoQf;AAED,UAAU,CAAC,MAAM,EAAE,CAAC;AAEpB,eAAe,UAAU,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { slot } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport FileUploader from \"@ui5/webcomponents/dist/FileUploader.js\";\nimport type { FileUploaderChangeEventDetail } from \"@ui5/webcomponents/dist/FileUploader.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { UPLOAD_BUTTON_LABEL } from \"./generated/i18n/i18n-defaults.js\";\nimport UDExButton from \"./Button.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UDExList from \"./List.js\";\nimport UDExUploadItem from \"./UploadItem.js\";\nimport UploadTemplate from \"./generated/templates/UploadTemplate.lit.js\";\nimport type FileData from \"./types/FileData.js\";\n\n// Styles\nimport UploadCss from \"./generated/themes/Upload.css.js\";\nimport { BreakpointUtils } from \"./utils/Breakpoints.js\";\n\nconst convertBytesToMegabytes = (bytes: number) => (bytes / 1024) / 1024;\n\ntype UDExUploadBaseEventDetail = {\n files: Array<FileData>\n}\n\ntype UDExUploadFileDeleteEventDetail = {\n file: UDExUploadItem,\n}\n\ntype UDExUploadFileChangeEventDetail = {\n files: Array<UDExUploadItem>\n}\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-upload</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/Upload.js\";</code>\n *\n * @constructor\n * @extends UI5Element\n * @public\n */\n@customElement({\n tag: \"udex-upload\",\n renderer: litRender,\n styles: UploadCss,\n template: UploadTemplate,\n dependencies: [FileUploader, UDExList, UDExButton, UDExUploadItem],\n})\n\n/**\n * Triggered when the uploaded file exceeds the maximum allowed size.\n *\n * @public\n */\n@event(\"file-size-exceed\", { bubbles: true })\n\n/**\n * Triggered when the user deletes the uploaded item.\n *\n * @public\n */\n@event(\"file-delete\", { bubbles: true })\n\n/**\n * Triggered when the user uploads the item.\n *\n * @public\n */\n@event(\"file-change\", { bubbles: true })\n\n/**\n * Triggered when the user attempts to upload a duplicate file.\n *\n * @public\n */\n@event(\"file-duplicate\", { bubbles: true })\n\n/**\n * Triggered when the user attempts to upload a file.\n *\n * @public\n */\n@event(\"change\", { bubbles: true })\n\nclass UDExUpload extends UI5Element {\n eventDetails!: {\n \"file-size-exceed\": UDExUploadBaseEventDetail,\n \"file-delete\": UDExUploadFileDeleteEventDetail,\n \"file-change\": UDExUploadFileChangeEventDetail,\n \"file-duplicate\": UDExUploadBaseEventDetail,\n \"change\": FileUploaderChangeEventDetail\n };\n /**\n * Defines the title of the upload.\n *\n * @public\n */\n @property({ type: String })\n uploadTitle!: string;\n\n /**\n * Defines an optional upporting message shown in 2 cases, both in single uplaod mode.\n * 1) When more than one file is uploaded and the button for uploading is clicked.\n * 2) When the button for uploading is disabled and a file has already been uploaded.\n *\n * @public\n */\n @property({ type: String })\n supportingText!: string;\n\n /**\n * Defines if uploader is required.\n *\n * @public\n */\n @property({ type: Boolean })\n required: boolean = false;\n\n /**\n * Defines if the button for uploading is disabled.\n *\n * @public\n */\n @property({ type: Boolean })\n disabled: boolean = false;\n\n /**\n * Defines if uploading multiple files is allowed.\n *\n * @public\n */\n @property({ type: Boolean })\n multiple!: boolean;\n\n /**\n * Defines the acceptable file formats for uploading.\n *\n * @public\n */\n @property({ type: String })\n accept!: string;\n\n /**\n * Defines the maximum allowed size of the file for uploading.\n *\n * @default undefined\n * @public\n */\n @property({ type: Number })\n maxFileSize!: number;\n\n /**\n * Defines the additional text below the title of the upload.\n *\n * @public\n */\n @property({ type: String })\n additionalText!: string;\n\n /**\n * Defines the text in the upload button.\n *\n * @public\n */\n @property({ type: String })\n uploadButtonText!: string;\n\n /**\n * Defines if a file is already uploaded when multiple is false.\n *\n * @private\n */\n @property({ type: Boolean })\n _filesFull: boolean = false;\n\n /**\n * Defines the uploaded files.\n *\n * @public\n */\n @slot({ type: HTMLElement, \"default\": true })\n items!: Array<UDExUploadItem>;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Large\"\n * @private\n */\n @property({ type: String })\n _buttonSize: `${UDExButtonSize}` = UDExButtonSize.Large;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n _uploadedFiles: FileData[] = [];\n _handleResizeBound: ResizeObserverCallback;\n\n constructor() {\n super();\n this._handleResizeBound = this._handleResize.bind(this);\n }\n\n onEnterDOM(): void {\n ResizeHandler.register(this, this._handleResizeBound);\n }\n\n onExitDOM(): void {\n ResizeHandler.deregister(this, this._handleResizeBound);\n }\n\n onAfterRendering(): void {\n if (this._filesFull) {\n this._filesFull = this.fileNumberExceeded;\n }\n }\n\n handleUploadClick(e: Event) {\n this._filesFull = this.fileNumberExceeded;\n if (this.fileNumberExceeded) {\n e.preventDefault();\n }\n }\n\n handleUploadFile(e: CustomEvent<FileUploaderChangeEventDetail>) {\n const { files } = e.target as HTMLInputElement;\n if (!files?.length || this.fileNumberExceeded) {\n e.stopPropagation();\n }\n\n const duplicateFiles = this._getDuplicateFiles(files!);\n if (duplicateFiles.length) {\n e.stopPropagation();\n this.fireDecoratorEvent(\"file-duplicate\", {\n files: duplicateFiles,\n });\n this.fileUploader.value = \"\";\n return;\n }\n\n const newFiles = Array.from(files!).map(file => ({\n fileName: file.name,\n fileSize: file.size,\n }));\n\n this._uploadedFiles = [...this._uploadedFiles, ...newFiles];\n\n const exceededFilesData = this.maxFileSize ? this._getExceededFiles(files!) : [];\n if (exceededFilesData.length) {\n e.stopPropagation();\n this.fireDecoratorEvent(\"file-size-exceed\", {\n files: exceededFilesData,\n });\n return;\n }\n\n this.fireEvent(\"change\", { files });\n }\n\n handleSelectionChange(e: CustomEvent) {\n const uploadedFiles = e.detail.listItems as UDExUploadItem[];\n this.fireDecoratorEvent(\"file-change\", { files: uploadedFiles });\n this.fileUploader.value = \"\";\n }\n\n _handleResize() {\n this._buttonSize = BreakpointUtils.isAtMost(\"S\") ? UDExButtonSize.Medium : UDExButtonSize.Large;\n }\n\n handleRemoveFile(e: CustomEvent) {\n const removedFile = e.target as UDExUploadItem;\n this.fireDecoratorEvent(\"file-delete\", { file: removedFile });\n this._uploadedFiles = this._uploadedFiles.filter(file => file.fileName !== removedFile.fileName);\n this.fileUploader.value = \"\";\n }\n\n _isDuplicateFile(file: string): boolean {\n return this._uploadedFiles.some(uploadedFile => uploadedFile.fileName === file);\n }\n\n _getExceededFiles(files: FileList): Array<FileData> {\n const filesArray = Array.from(files);\n const exceededFiles: Array<FileData> = [];\n\n for (let i = 0; i < filesArray.length; i++) {\n const fileSize = convertBytesToMegabytes(filesArray[i].size);\n if (fileSize > this.maxFileSize) {\n exceededFiles.push({\n fileName: filesArray[i].name,\n fileSize,\n });\n }\n }\n return exceededFiles;\n }\n\n _getDuplicateFiles(files: FileList): Array<FileData> {\n const filesArray = Array.from(files);\n const duplicateFiles: Array<FileData> = [];\n\n for (let i = 0; i < filesArray.length; i++) {\n const fileSize = convertBytesToMegabytes(filesArray[i].size);\n const { name } = filesArray[i];\n\n const potentialDuplicate: FileData = {\n fileSize,\n fileName: name,\n };\n\n if (this._isDuplicateFile(potentialDuplicate.fileName)) {\n duplicateFiles.push(potentialDuplicate);\n }\n }\n\n return duplicateFiles;\n }\n\n get showSupportingText(): boolean {\n return this.disabled || this._filesFull;\n }\n\n get supportingTextClasses(): string {\n if (this.disabled && !!this.supportingText) {\n return \"udex-upload__supporting-text\";\n }\n return \"udex-upload__supporting-error-text\";\n }\n\n get fileUploader(): HTMLInputElement {\n const uploader = this.shadowRoot!.querySelector<FileUploader>(\"[ui5-file-uploader]\")!;\n return uploader.shadowRoot!.querySelector(\"input\")!;\n }\n\n get uploadButtonAriaLabel(): string {\n return UDExUpload.i18nBundle.getText(UPLOAD_BUTTON_LABEL);\n }\n\n get listBusy(): boolean {\n return !this.items.length;\n }\n\n get fileNumberExceeded(): boolean {\n return !this.multiple && this.items.length >= 1;\n }\n}\n\nUDExUpload.define();\n\nexport default UDExUpload;\nexport type { UDExUploadBaseEventDet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,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAExC;;;;;OAKG;;IACF,KAAK,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE3C;;;;;OAKG;;IACF,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAE7B,UAAU,CAoQf;AAED,UAAU,CAAC,MAAM,EAAE,CAAC;AAEpB,eAAe,UAAU,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { slot } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport FileUploader from \"@ui5/webcomponents/dist/FileUploader.js\";\nimport type { FileUploaderChangeEventDetail } from \"@ui5/webcomponents/dist/FileUploader.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { UPLOAD_BUTTON_LABEL } from \"./generated/i18n/i18n-defaults.js\";\nimport UDExButton from \"./Button.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UDExList from \"./List.js\";\nimport UDExUploadItem from \"./UploadItem.js\";\nimport UploadTemplate from \"./generated/templates/UploadTemplate.lit.js\";\nimport type FileData from \"./types/FileData.js\";\n\n// Styles\nimport UploadCss from \"./generated/themes/Upload.css.js\";\nimport { BreakpointUtils } from \"./utils/Breakpoints.js\";\n\nconst convertBytesToMegabytes = (bytes: number) => (bytes / 1024) / 1024;\n\ntype UDExUploadBaseEventDetail = {\n files: Array<FileData>\n}\n\ntype UDExUploadFileDeleteEventDetail = {\n file: UDExUploadItem,\n}\n\ntype UDExUploadFileChangeEventDetail = {\n files: Array<UDExUploadItem>\n}\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-upload</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/Upload.js\";</code>\n *\n * @constructor\n * @extends UI5Element\n * @public\n */\n@customElement({\n tag: \"udex-upload\",\n renderer: litRender,\n styles: UploadCss,\n template: UploadTemplate,\n dependencies: [FileUploader, UDExList, UDExButton, UDExUploadItem],\n})\n\n/**\n * Triggered when the uploaded file exceeds the maximum allowed size.\n *\n * @public\n * @param {Array<FileData>} files An array of files that exceed the maximum allowed size.\n */\n@event(\"file-size-exceed\", { bubbles: true })\n\n/**\n * Triggered when the user deletes the uploaded item.\n *\n * @public\n * @param {UDExUploadItem} file The deleted upload item.\n */\n@event(\"file-delete\", { bubbles: true })\n\n/**\n * Triggered when the user uploads the item.\n *\n * @public\n * @param {Array<UDExUploadItem>} files An array of the uploaded items.\n */\n@event(\"file-change\", { bubbles: true })\n\n/**\n * Triggered when the user attempts to upload a duplicate file.\n *\n * @public\n * @param {Array<FileData>} files An array of duplicate files.\n */\n@event(\"file-duplicate\", { bubbles: true })\n\n/**\n * Triggered when the user attempts to upload a file.\n *\n * @public\n * @param {FileList} files The uploaded files.\n */\n@event(\"change\", { bubbles: true })\n\nclass UDExUpload extends UI5Element {\n eventDetails!: {\n \"file-size-exceed\": UDExUploadBaseEventDetail,\n \"file-delete\": UDExUploadFileDeleteEventDetail,\n \"file-change\": UDExUploadFileChangeEventDetail,\n \"file-duplicate\": UDExUploadBaseEventDetail,\n \"change\": FileUploaderChangeEventDetail\n };\n /**\n * Defines the title of the upload.\n *\n * @public\n */\n @property({ type: String })\n uploadTitle!: string;\n\n /**\n * Defines an optional upporting message shown in 2 cases, both in single uplaod mode.\n * 1) When more than one file is uploaded and the button for uploading is clicked.\n * 2) When the button for uploading is disabled and a file has already been uploaded.\n *\n * @public\n */\n @property({ type: String })\n supportingText!: string;\n\n /**\n * Defines if uploader is required.\n *\n * @public\n */\n @property({ type: Boolean })\n required: boolean = false;\n\n /**\n * Defines if the button for uploading is disabled.\n *\n * @public\n */\n @property({ type: Boolean })\n disabled: boolean = false;\n\n /**\n * Defines if uploading multiple files is allowed.\n *\n * @public\n */\n @property({ type: Boolean })\n multiple!: boolean;\n\n /**\n * Defines the acceptable file formats for uploading.\n *\n * @public\n */\n @property({ type: String })\n accept!: string;\n\n /**\n * Defines the maximum allowed size of the file for uploading.\n *\n * @default undefined\n * @public\n */\n @property({ type: Number })\n maxFileSize!: number;\n\n /**\n * Defines the additional text below the title of the upload.\n *\n * @public\n */\n @property({ type: String })\n additionalText!: string;\n\n /**\n * Defines the text in the upload button.\n *\n * @public\n */\n @property({ type: String })\n uploadButtonText!: string;\n\n /**\n * Defines if a file is already uploaded when multiple is false.\n *\n * @private\n */\n @property({ type: Boolean })\n _filesFull: boolean = false;\n\n /**\n * Defines the uploaded files.\n *\n * @public\n */\n @slot({ type: HTMLElement, \"default\": true })\n items!: Array<UDExUploadItem>;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Large\"\n * @private\n */\n @property({ type: String })\n _buttonSize: `${UDExButtonSize}` = UDExButtonSize.Large;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n _uploadedFiles: FileData[] = [];\n _handleResizeBound: ResizeObserverCallback;\n\n constructor() {\n super();\n this._handleResizeBound = this._handleResize.bind(this);\n }\n\n onEnterDOM(): void {\n ResizeHandler.register(this, this._handleResizeBound);\n }\n\n onExitDOM(): void {\n ResizeHandler.deregister(this, this._handleResizeBound);\n }\n\n onAfterRendering(): void {\n if (this._filesFull) {\n this._filesFull = this.fileNumberExceeded;\n }\n }\n\n handleUploadClick(e: Event) {\n this._filesFull = this.fileNumberExceeded;\n if (this.fileNumberExceeded) {\n e.preventDefault();\n }\n }\n\n handleUploadFile(e: CustomEvent<FileUploaderChangeEventDetail>) {\n const { files } = e.target as HTMLInputElement;\n if (!files?.length || this.fileNumberExceeded) {\n e.stopPropagation();\n }\n\n const duplicateFiles = this._getDuplicateFiles(files!);\n if (duplicateFiles.length) {\n e.stopPropagation();\n this.fireDecoratorEvent(\"file-duplicate\", {\n files: duplicateFiles,\n });\n this.fileUploader.value = \"\";\n return;\n }\n\n const newFiles = Array.from(files!).map(file => ({\n fileName: file.name,\n fileSize: file.size,\n }));\n\n this._uploadedFiles = [...this._uploadedFiles, ...newFiles];\n\n const exceededFilesData = this.maxFileSize ? this._getExceededFiles(files!) : [];\n if (exceededFilesData.length) {\n e.stopPropagation();\n this.fireDecoratorEvent(\"file-size-exceed\", {\n files: exceededFilesData,\n });\n return;\n }\n\n this.fireEvent(\"change\", { files });\n }\n\n handleSelectionChange(e: CustomEvent) {\n const uploadedFiles = e.detail.listItems as UDExUploadItem[];\n this.fireDecoratorEvent(\"file-change\", { files: uploadedFiles });\n this.fileUploader.value = \"\";\n }\n\n _handleResize() {\n this._buttonSize = BreakpointUtils.isAtMost(\"S\") ? UDExButtonSize.Medium : UDExButtonSize.Large;\n }\n\n handleRemoveFile(e: CustomEvent) {\n const removedFile = e.target as UDExUploadItem;\n this.fireDecoratorEvent(\"file-delete\", { file: removedFile });\n this._uploadedFiles = this._uploadedFiles.filter(file => file.fileName !== removedFile.fileName);\n this.fileUploader.value = \"\";\n }\n\n _isDuplicateFile(file: string): boolean {\n return this._uploadedFiles.some(uploadedFile => uploadedFile.fileName === file);\n }\n\n _getExceededFiles(files: FileList): Array<FileData> {\n const filesArray = Array.from(files);\n const exceededFiles: Array<FileData> = [];\n\n for (let i = 0; i < filesArray.length; i++) {\n const fileSize = convertBytesToMegabytes(filesArray[i].size);\n if (fileSize > this.maxFileSize) {\n exceededFiles.push({\n fileName: filesArray[i].name,\n fileSize,\n });\n }\n }\n return exceededFiles;\n }\n\n _getDuplicateFiles(files: FileList): Array<FileData> {\n const filesArray = Array.from(files);\n const duplicateFiles: Array<FileData> = [];\n\n for (let i = 0; i < filesArray.length; i++) {\n const fileSize = convertBytesToMegabytes(filesArray[i].size);\n const { name } = filesArray[i];\n\n const potentialDuplicate: FileData = {\n fileSize,\n fileName: name,\n };\n\n if (this._isDuplicateFile(potentialDuplicate.fileName)) {\n duplicateFiles.push(potentialDuplicate);\n }\n }\n\n return duplicateFiles;\n }\n\n get showSupportingText(): boolean {\n return this.disabled || this._filesFull;\n }\n\n get supportingTextClasses(): string {\n if (this.disabled && !!this.supportingText) {\n return \"udex-upload__supporting-text\";\n }\n return \"udex-upload__supporting-error-text\";\n }\n\n get fileUploader(): HTMLInputElement {\n const uploader = this.shadowRoot!.querySelector<FileUploader>(\"[ui5-file-uploader]\")!;\n return uploader.shadowRoot!.querySelector(\"input\")!;\n }\n\n get uploadButtonAriaLabel(): string {\n return UDExUpload.i18nBundle.getText(UPLOAD_BUTTON_LABEL);\n }\n\n get listBusy(): boolean {\n return !this.items.length;\n }\n\n get fileNumberExceeded(): boolean {\n return !this.multiple && this.items.length >= 1;\n }\n}\n\nUDExUpload.define();\n\nexport default UDExUpload;\nexport type { UDExUploadBaseEventDetail, UDExUploadFileChangeEventDetail, UDExUploadFileDeleteEventDetail };\n"]}
@@ -1,2 +1,2 @@
1
- import{r as w,j as l,a as c,p as x,d as P,b as R,s as p,m as v,u as S,v as y,w as O,x as L,D,c as A,z as G,I as b,A as I,F as H,B as f,R as E,C as V,G as $,H as B,J as N}from"./bundle.esm-C7AybWk0.js";const F=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function _(n,e,t,s){return n.replaceAll(new RegExp(F(e),`${s?"i":""}g`),t)}function M(n,e){if(!n||!e)return n;const t=r=>{const[a,d]=r.split("");for(;n.indexOf(r)>=0||e.indexOf(r)>=0;)r=`${a}${r}${d}`;return r},s=t("12"),i=t("34");let o=w(_(n,e,r=>`${s}${r}${i}`,!0));return[[s,"<b>"],[i,"</b>"]].forEach(([r,a])=>{o=_(o,r,a,!1)}),o}function z(n,e){const t=(n==null?void 0:n.listItemContent)||q;return l("li",{part:"native-li","data-sap-focus-ref":!0,tabindex:this._effectiveTabIndex,class:this.classes.main,draggable:this.movable,role:e==null?void 0:e.role,title:e==null?void 0:e.title,onFocusIn:this._onfocusin,onKeyUp:this._onkeyup,onKeyDown:this._onkeydown,onClick:this._onclick,children:t.call(this)})}function q(){return l("div",{part:"content",id:`${this._id}-content`,class:"ui5-li-content",children:l("div",{class:"ui5-li-text-wrapper",children:l("span",{part:"title",class:"ui5-li-title",children:l("slot",{})})})})}function U(){return[z.call(this,{listItemContent:K},{role:"option"})]}function K(){return l("div",{part:"content",id:"content",class:"ui5-li-content",children:c("div",{class:"ui5-li-text-wrapper",children:[l("span",{part:"title",className:"ui5-li-title",dangerouslySetInnerHTML:{__html:this.markupText}}),this.additionalText&&l("span",{part:"additional-text",class:"ui5-li-additional-text",children:this.additionalText})]})})}x("@ui5/webcomponents-theming","sap_horizon",async()=>P);x("@ui5/webcomponents","sap_horizon",async()=>R);const W=`:host([ui5-suggestion-item]){height:auto;min-height:var(--_ui5-v2-17-0_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-root{min-height:var(--_ui5-v2-17-0_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-content{padding-bottom:.5rem;padding-top:.5rem;box-sizing:border-box}
1
+ import{r as w,j as l,a as c,p as x,d as P,b as R,s as p,m as v,u as S,v as y,w as O,x as L,D,c as A,z as G,I as b,A as I,F as H,B as f,R as E,C as V,G as $,H as B,J as N}from"./bundle.esm-9yDdQqR5.js";const F=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function _(n,e,t,s){return n.replaceAll(new RegExp(F(e),`${s?"i":""}g`),t)}function M(n,e){if(!n||!e)return n;const t=r=>{const[a,d]=r.split("");for(;n.indexOf(r)>=0||e.indexOf(r)>=0;)r=`${a}${r}${d}`;return r},s=t("12"),i=t("34");let o=w(_(n,e,r=>`${s}${r}${i}`,!0));return[[s,"<b>"],[i,"</b>"]].forEach(([r,a])=>{o=_(o,r,a,!1)}),o}function z(n,e){const t=(n==null?void 0:n.listItemContent)||q;return l("li",{part:"native-li","data-sap-focus-ref":!0,tabindex:this._effectiveTabIndex,class:this.classes.main,draggable:this.movable,role:e==null?void 0:e.role,title:e==null?void 0:e.title,onFocusIn:this._onfocusin,onKeyUp:this._onkeyup,onKeyDown:this._onkeydown,onClick:this._onclick,children:t.call(this)})}function q(){return l("div",{part:"content",id:`${this._id}-content`,class:"ui5-li-content",children:l("div",{class:"ui5-li-text-wrapper",children:l("span",{part:"title",class:"ui5-li-title",children:l("slot",{})})})})}function U(){return[z.call(this,{listItemContent:K},{role:"option"})]}function K(){return l("div",{part:"content",id:"content",class:"ui5-li-content",children:c("div",{class:"ui5-li-text-wrapper",children:[l("span",{part:"title",className:"ui5-li-title",dangerouslySetInnerHTML:{__html:this.markupText}}),this.additionalText&&l("span",{part:"additional-text",class:"ui5-li-additional-text",children:this.additionalText})]})})}x("@ui5/webcomponents-theming","sap_horizon",async()=>P);x("@ui5/webcomponents","sap_horizon",async()=>R);const W=`:host([ui5-suggestion-item]){height:auto;min-height:var(--_ui5-v2-17-0_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-root{min-height:var(--_ui5-v2-17-0_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-content{padding-bottom:.5rem;padding-top:.5rem;box-sizing:border-box}
2
2
  `;var g=function(n,e,t,s){var i=arguments.length,o=i<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};let h=class extends S{constructor(){super(...arguments),this.markupText=""}onEnterDOM(){y()&&this.setAttribute("desktop","")}get _effectiveTabIndex(){return-1}};g([p()],h.prototype,"text",void 0);g([p()],h.prototype,"additionalText",void 0);g([p()],h.prototype,"markupText",void 0);h=g([v({tag:"ui5-suggestion-item",template:U,styles:[S.styles,W]})],h);h.define();function J(n){const e=(n==null?void 0:n.items)||X;return c("ul",{role:"group",class:"ui5-group-li-root",onDragEnter:this._ondragenter,onDragOver:this._ondragover,onDrop:this._ondrop,onDragLeave:this._ondragleave,children:[this.hasHeader&&l(L,{focused:this.focused,part:"header",accessibleRole:O.Group,children:this.hasFormattedHeader?l("slot",{name:"header"}):this.headerText}),e.call(this),l(D,{orientation:"Horizontal",ownerReference:this})]})}function X(){return l("slot",{})}var T=function(n,e,t,s){var i=arguments.length,o=i<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};let m=class extends G{};T([A({default:!0,invalidateOnChildChange:!0,type:HTMLElement})],m.prototype,"items",void 0);m=T([v({tag:"ui5-suggestion-item-group",template:J})],m);m.define();function j(n){const e=(n==null?void 0:n.suggestionsList)||Q,t=n==null?void 0:n.mobileHeader,s=n==null?void 0:n.valueStateMessage,i=n==null?void 0:n.valueStateMessageInputIcon;return c(E,{class:this.classes.popover,hideArrow:!0,preventFocusRestore:!0,preventInitialFocus:!0,placement:"Bottom",horizontalAlign:"Start",tabindex:-1,style:this.styles.suggestionsPopover,onOpen:this._afterOpenPicker,onClose:this._afterClosePicker,onScroll:this._scroll,open:this.open,opener:this,accessibleName:this._popupLabel,children:[this._isPhone&&l(H,{children:c("div",{slot:"header",class:"ui5-responsive-popover-header",children:[l("div",{class:"row",children:l("span",{children:this._headerTitleText})}),l("div",{class:"row",children:c("div",{class:"input-root-phone native-input-wrapper",children:[l(b,{class:"ui5-input-inner-phone",type:this.inputType,value:this.value,showClearIcon:this.showClearIcon,placeholder:this.placeholder,onInput:this._handleInput}),t==null?void 0:t.call(this)]})}),this.hasValueStateMessage&&c("div",{class:this.classes.popoverValueState,style:this.styles.suggestionPopoverHeader,children:[l(I,{class:"ui5-input-value-state-message-icon",name:i==null?void 0:i.call(this)}),this.open&&(s==null?void 0:s.call(this))]})]})}),!this._isPhone&&this.hasValueStateMessage&&c("div",{slot:"header",class:{"ui5-responsive-popover-header":!0,...this.classes.popoverValueState},style:this.styles.suggestionPopoverHeader,children:[l(I,{class:"ui5-input-value-state-message-icon",name:i==null?void 0:i.call(this)}),this.open&&(s==null?void 0:s.call(this))]}),this.showSuggestions&&e.call(this),this._isPhone&&c("div",{slot:"footer",class:"ui5-responsive-popover-footer",children:[l(f,{design:"Emphasized",onClick:this._confirmMobileValue,children:this._suggestionsOkButtonText}),l(f,{class:"ui5-responsive-popover-close-btn",design:"Transparent",onClick:this._cancelMobileValue,children:this._suggestionsCancelButtonText})]})]})}function Q(){return l($,{accessibleRole:V.ListBox,separators:this.suggestionSeparators,selectionMode:"Single",onMouseDown:this.onItemMouseDown,onItemClick:this._handleSuggestionItemPress,onSelectionChange:this._handleSelectionChange,children:l("slot",{})})}class u{get template(){return j}constructor(e,t,s,i){this.component=e,this.slotName=t,this.handleFocus=i,this.highlight=s,this.selectedItemIndex=-1}onUp(e,t){e.preventDefault();const s=!this.isOpened&&this._hasValueState&&t===-1?0:t;return this._handleItemNavigation(!1,s),!0}onDown(e,t){e.preventDefault();const s=!this.isOpened&&this._hasValueState&&t===-1?0:t;return this._handleItemNavigation(!0,s),!0}onSpace(e){return this._isItemOnTarget()?(e.preventDefault(),this.onItemSelected(this._selectedItem,!0),!0):!1}onEnter(e){return this._isGroupItem?(e.preventDefault(),!1):this._isItemOnTarget()?(this.onItemSelected(this._selectedItem,!0),!0):!1}onPageUp(e){e.preventDefault();const t=this.selectedItemIndex-10>-1;return this._moveItemSelection(this.selectedItemIndex,t?this.selectedItemIndex-=10:this.selectedItemIndex=0),!0}onPageDown(e){e.preventDefault();const t=this._getItems();if(!t)return!0;const s=t.length-1,i=this.selectedItemIndex+10<=s;return this._moveItemSelection(this.selectedItemIndex,i?this.selectedItemIndex+=10:this.selectedItemIndex=s),!0}onHome(e){return e.preventDefault(),this._moveItemSelection(this.selectedItemIndex,this.selectedItemIndex=0),!0}onEnd(e){e.preventDefault();const t=this._getItems().length-1;return t&&this._moveItemSelection(this.selectedItemIndex,this.selectedItemIndex=t),!0}onTab(){return this._isItemOnTarget()?(this.onItemSelected(this._selectedItem,!0),!0):!1}toggle(e,t){(e!==void 0?e:!this.isOpened())?this._getComponent().open=!0:this.close(t.preventFocusRestore)}get _selectedItem(){return this._getNonGroupItems().find(e=>e.selected)}_isScrollable(){const e=this._getScrollContainer();return e.offsetHeight<e.scrollHeight}close(e=!1){const t=this._getItems()&&this._getItems()[this.selectedItemIndex];this._getComponent().open=!1;const s=this._getPicker();s.preventFocusRestore=e,s.open=!1,t&&t.focused&&(t.focused=!1)}updateSelectedItemPosition(e){this.selectedItemIndex=e}onItemSelected(e,t){const s=e,i=this._getNonGroupItems();s&&(this.accInfo={isGroup:s.hasAttribute("ui5-suggestion-item-group"),currentPos:i.indexOf(s)+1,listSize:i.length,itemText:s.text||"",additionalText:s.additionalText},this._getComponent().onItemSelected(s,t),this._getComponent().open=!1)}onItemSelect(e){this._getComponent().onItemSelect(e)}onItemPress(e){let t;const s=e.type==="ui5-item-click";s&&!e.detail.item.selected||this._handledPress&&!s||(s&&e.detail.item.selected?(t=e.detail.item,this._handledPress=!0):t=e.detail.selectedItems[0],this.onItemSelected(t,!1))}_onClose(){this._handledPress=!1}_isItemOnTarget(){return this.isOpened()&&this.selectedItemIndex!==null&&this.selectedItemIndex!==-1&&!this._isGroupItem}get _isGroupItem(){const e=this._getItems();return!e||!e[this.selectedItemIndex]?!1:e[this.selectedItemIndex].hasAttribute("ui5-suggestion-item-group")}isOpened(){var e;return!!((e=this._getPicker())!=null&&e.open)}_handleItemNavigation(e,t){this.selectedItemIndex=t,this._getItems().length&&(e?this._selectNextItem():this._selectPreviousItem())}_selectNextItem(){const e=this._getItems().length,t=this.selectedItemIndex;t!==-1&&t+1>e-1||this._moveItemSelection(t,++this.selectedItemIndex)}_selectPreviousItem(){const e=this._getItems(),t=this.selectedItemIndex;if(!(t===-1||t===null)){if(t-1<0){(e[t].hasAttribute("ui5-suggestion-item")||e[t].hasAttribute("ui5-suggestion-item-custom"))&&(e[t].selected=!1),e[t].focused=!1,this.component.focused=!0,this.component.hasSuggestionItemSelected=!1,this.selectedItemIndex-=1;return}this._moveItemSelection(t,--this.selectedItemIndex)}}_moveItemSelection(e,t){const s=this._getItems(),i=s[t],o=s[e],r=this._getNonGroupItems(),a=i.hasAttribute("ui5-suggestion-item-group");if(!i)return;this.component.focused=!1;const d=this._getItems()[this.selectedItemIndex];if(this.accInfo={isGroup:a,currentPos:s.indexOf(i)+1,itemText:(a?d.headerText:d.text)||""},(i.hasAttribute("ui5-suggestion-item")||i.hasAttribute("ui5-suggestion-item-custom"))&&(this.accInfo.additionalText=i.additionalText||"",this.accInfo.currentPos=r.indexOf(i)+1,this.accInfo.listSize=r.length),o&&(o.focused=!1),(o!=null&&o.hasAttribute("ui5-suggestion-item")||o!=null&&o.hasAttribute("ui5-suggestion-item-custom"))&&(o.selected=!1),i&&(i.focused=!0,a||(i.selected=!0),this.handleFocus&&i.focus()),this.component.hasSuggestionItemSelected=!0,this.onItemSelect(i),!this._isItemIntoView(i)){const C=this._isGroupItem?i.shadowRoot.querySelector("[ui5-li-group-header]"):i;this._scrollItemIntoView(C)}}_deselectItems(){this._getItems().forEach(t=>{t.hasAttribute("ui5-suggestion-item")&&(t.selected=!1),t.focused=!1})}_clearItemFocus(){const e=this._getItems().find(t=>t.focused);e&&(e.focused=!1)}_isItemIntoView(e){const t=e.getDomRef().getBoundingClientRect(),s=this._getComponent().getDomRef().getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight;let o=0;return this._hasValueState&&(o=this._getPicker().querySelector("[slot=header]").getBoundingClientRect().height),t.top+u.SCROLL_STEP<=i&&t.top>=s.top+o}_scrollItemIntoView(e){e.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}_getScrollContainer(){return this._scrollContainer||(this._scrollContainer=this._getPicker().shadowRoot.querySelector(".ui5-popup-content")),this._scrollContainer}_getItems(){return this._getComponent().getSlottedNodes("suggestionItems").flatMap(t=>t.hasAttribute("ui5-suggestion-item-group")?[t,...t.items]:[t])}_getNonGroupItems(){return this._getItems().filter(e=>!e.hasAttribute("ui5-suggestion-item-group"))}_getComponent(){return this.component}_getList(){return this._getPicker().querySelector("[ui5-list]")}_getListWidth(){var e;return(e=this._getList())==null?void 0:e.offsetWidth}_getPicker(){return this._getComponent().shadowRoot.querySelector("[ui5-responsive-popover]")}get itemSelectionAnnounce(){if(!this.accInfo)return"";if(this.accInfo.isGroup)return`${u.i18nBundle.getText(B)} ${this.accInfo.itemText}`;const e=u.i18nBundle.getText(N,this.accInfo.currentPos||0,this.accInfo.listSize||0);return`${this.accInfo.additionalText} ${e}`}hightlightInput(e,t){return M(e,t)}get _hasValueState(){return this.component.hasValueStateMessage}_clearSelectedSuggestionAndaccInfo(){this.accInfo=void 0,this.selectedItemIndex=0}}u.SCROLL_STEP=60;b.SuggestionsClass=u;export{u as default};
@@ -1,3 +1,3 @@
1
- import{j as o,a as _,F as y,p as m,d as b,b as E,s as x,c as C,i as P,m as O,y as B,e as w,f as I,t as A,E as L,g as R,L as S,R as M,B as N,h as F,k as D,l as X,n as j,o as z,q as k}from"./bundle.esm-C7AybWk0.js";var T;(function(t){t.InPlace="InPlace",t.Popover="Popover"})(T||(T={}));const $=T;var g;(function(t){t.Off="Off",t.On="On"})(g||(g={}));const H=g;function W(){return o(y,{children:o("span",{children:this._renderEmptyIndicator?_(y,{children:[o("span",{className:"empty-indicator","aria-hidden":"true",children:this._emptyIndicatorSymbol}),o("span",{className:"empty-indicator-aria-label",children:this._emptyIndicatorAriaLabel})]}):o("slot",{})})})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E);const q=`:host{max-width:100%;font-size:var(--sapFontSize);font-family:var(--sapFontFamily);color:var(--sapTextColor);line-height:normal;cursor:text;overflow:hidden}:host([max-lines="1"]){display:inline-block;text-overflow:ellipsis;white-space:nowrap}:host(:not([max-lines="1"])){display:-webkit-box;-webkit-line-clamp:var(--_ui5-v2-17-0_text_max_lines);line-clamp:var(--_ui5-v2-17-0_text_max_lines);-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}.empty-indicator-aria-label{position:absolute!important;clip:rect(1px,1px,1px,1px);user-select:none;left:0;top:0;font-size:0}
1
+ import{j as o,a as _,F as y,p as m,d as b,b as E,s as x,c as C,i as P,m as O,y as B,e as w,f as I,t as A,E as L,g as R,L as S,R as M,B as N,h as F,k as D,l as X,n as j,o as z,q as k}from"./bundle.esm-9yDdQqR5.js";var T;(function(t){t.InPlace="InPlace",t.Popover="Popover"})(T||(T={}));const $=T;var g;(function(t){t.Off="Off",t.On="On"})(g||(g={}));const H=g;function W(){return o(y,{children:o("span",{children:this._renderEmptyIndicator?_(y,{children:[o("span",{className:"empty-indicator","aria-hidden":"true",children:this._emptyIndicatorSymbol}),o("span",{className:"empty-indicator-aria-label",children:this._emptyIndicatorAriaLabel})]}):o("slot",{})})})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E);const q=`:host{max-width:100%;font-size:var(--sapFontSize);font-family:var(--sapFontFamily);color:var(--sapTextColor);line-height:normal;cursor:text;overflow:hidden}:host([max-lines="1"]){display:inline-block;text-overflow:ellipsis;white-space:nowrap}:host(:not([max-lines="1"])){display:-webkit-box;-webkit-line-clamp:var(--_ui5-v2-17-0_text_max_lines);line-clamp:var(--_ui5-v2-17-0_text_max_lines);-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}.empty-indicator-aria-label{position:absolute!important;clip:rect(1px,1px,1px,1px);user-select:none;left:0;top:0;font-size:0}
2
2
  `;var u=function(t,e,n,s){var a=arguments.length,i=a<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,n):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,s);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(i=(a<3?l(i):a>3?l(e,n,i):l(e,n))||i);return a>3&&i&&Object.defineProperty(e,n,i),i},f;let p=f=class extends w{constructor(){super(...arguments),this.maxLines=1/0,this.emptyIndicatorMode="Off"}onBeforeRendering(){this.style.setProperty(I("--_ui5_text_max_lines"),`${this.maxLines}`)}get hasText(){return A(this.text)}get _renderEmptyIndicator(){return!this.hasText&&this.emptyIndicatorMode===H.On}get _emptyIndicatorAriaLabel(){return f.i18nBundle.getText(L)}get _emptyIndicatorSymbol(){return f.i18nBundle.getText(R)}};u([x({type:Number})],p.prototype,"maxLines",void 0);u([x()],p.prototype,"emptyIndicatorMode",void 0);u([C({type:Node,default:!0})],p.prototype,"text",void 0);u([P("@ui5/webcomponents")],p,"i18nBundle",void 0);p=f=u([O({tag:"ui5-text",renderer:B,template:W,styles:q})],p);p.define();const v=p;function Y(){return _("div",{children:[o(v,{class:"ui5-exp-text-text",emptyIndicatorMode:this.emptyIndicatorMode,children:this._displayedText}),this._maxCharactersExceeded&&_(y,{children:[o("span",{class:"ui5-exp-text-ellipsis",children:this._ellipsisText}),o(S,{id:"toggle",class:"ui5-exp-text-toggle",accessibleRole:"Button",accessibleName:this._accessibleNameForToggle,accessibilityAttributes:this._accessibilityAttributesForToggle,onClick:this._handleToggleClick,children:this._textForToggle}),this._usePopover&&_(M,{open:this._expanded,opener:"toggle",accessibleNameRef:"popover-text",contentOnlyOnDesktop:!0,_hideHeader:!0,class:"ui5-exp-text-popover",onClose:this._handlePopoverClose,children:[o(v,{id:"popover-text",children:this.text}),o("div",{slot:"footer",class:"ui5-exp-text-footer",children:o(N,{design:"Transparent",onClick:this._handleCloseButtonClick,children:this._closeButtonText})})]})]})]})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E);const V=`:host{display:inline-block;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);color:var(--sapTextColor)}:host([hidden]){display:none}.ui5-exp-text-text{display:inline}.ui5-exp-text-text,.ui5-exp-text-toggle{font-family:inherit;font-size:inherit}.ui5-exp-text-text,.ui5-exp-text-ellipsis{color:inherit}.ui5-exp-text-popover::part(content){padding-inline:1rem}.ui5-exp-text-footer{width:100%;display:flex;align-items:center;justify-content:flex-end}
3
3
  `;var h=function(t,e,n,s){var a=arguments.length,i=a<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,n):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,s);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(i=(a<3?l(i):a>3?l(e,n,i):l(e,n))||i);return a>3&&i&&Object.defineProperty(e,n,i),i},c;let r=c=class extends w{constructor(){super(...arguments),this.maxCharacters=100,this.overflowMode="InPlace",this.emptyIndicatorMode="Off",this._expanded=!1}getFocusDomRef(){var e,n;return this._usePopover?(e=this.shadowRoot)==null?void 0:e.querySelector("[ui5-responsive-popover]"):(n=this.shadowRoot)==null?void 0:n.querySelector("[ui5-link]")}get _displayedText(){var e;return this._expanded&&!this._usePopover?this.text:(e=this.text)==null?void 0:e.substring(0,this.maxCharacters)}get _maxCharactersExceeded(){var e;return(((e=this.text)==null?void 0:e.length)||0)>this.maxCharacters}get _usePopover(){return this.overflowMode===$.Popover}get _ellipsisText(){return this._expanded&&!this._usePopover?" ":"... "}get _textForToggle(){return this._expanded?c.i18nBundle.getText(F):c.i18nBundle.getText(D)}get _closeButtonText(){return c.i18nBundle.getText(X)}get _accessibilityAttributesForToggle(){return this._usePopover?{expanded:this._expanded,hasPopup:"dialog"}:{expanded:this._expanded}}get _accessibleNameForToggle(){if(this._usePopover)return this._expanded?c.i18nBundle.getText(j):c.i18nBundle.getText(z)}_handlePopoverClose(){k()||(this._expanded=!1)}_handleToggleClick(){this._expanded=!this._expanded}_handleCloseButtonClick(e){this._expanded=!1,e.stopPropagation()}};h([x()],r.prototype,"text",void 0);h([x({type:Number})],r.prototype,"maxCharacters",void 0);h([x()],r.prototype,"overflowMode",void 0);h([x()],r.prototype,"emptyIndicatorMode",void 0);h([x({type:Boolean})],r.prototype,"_expanded",void 0);h([P("@ui5/webcomponents")],r,"i18nBundle",void 0);r=c=h([O({tag:"ui5-expandable-text",renderer:B,styles:V,template:Y})],r);r.define();function Q(t){const{className:e,text:n,maxCharacters:s,part:a}=t;return o(r,{part:a,class:e,text:n,maxCharacters:s})}export{Q as default};