@sapudex/web-components 2.55.0 → 2.56.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 (275) hide show
  1. package/cypress/specs/HeroBanner.cy.tsx +35 -1
  2. package/cypress/specs/List.cy.tsx +63 -1
  3. package/cypress/specs/ListItem.cy.tsx +44 -0
  4. package/cypress/specs/MastheadShell.cy.tsx +39 -0
  5. package/cypress/specs/PhoneNumberField.cy.tsx +29 -1
  6. package/cypress/specs/SelectBox.cy.tsx +99 -0
  7. package/dist/CountrySelectorTemplate.js +1 -1
  8. package/dist/CountrySelectorTemplate.js.map +1 -1
  9. package/dist/FilterMenu.js +5 -1
  10. package/dist/FilterMenu.js.map +1 -1
  11. package/dist/HeroBanner.d.ts +12 -0
  12. package/dist/HeroBanner.js +54 -0
  13. package/dist/HeroBanner.js.map +1 -1
  14. package/dist/List.d.ts +5 -0
  15. package/dist/List.js +7 -0
  16. package/dist/List.js.map +1 -1
  17. package/dist/ListItem.js +5 -1
  18. package/dist/ListItem.js.map +1 -1
  19. package/dist/ListTemplate.js +1 -1
  20. package/dist/ListTemplate.js.map +1 -1
  21. package/dist/MastheadShell.d.ts +7 -0
  22. package/dist/MastheadShell.js +38 -0
  23. package/dist/MastheadShell.js.map +1 -1
  24. package/dist/PhoneNumberField.d.ts +3 -3
  25. package/dist/PhoneNumberField.js +18 -21
  26. package/dist/PhoneNumberField.js.map +1 -1
  27. package/dist/PhoneNumberFieldTemplate.d.ts +2 -0
  28. package/dist/PhoneNumberFieldTemplate.js +12 -0
  29. package/dist/PhoneNumberFieldTemplate.js.map +1 -0
  30. package/dist/Search.d.ts +2 -0
  31. package/dist/Search.js +21 -0
  32. package/dist/Search.js.map +1 -1
  33. package/dist/SearchableListBase.d.ts +4 -0
  34. package/dist/SearchableListBase.js +66 -6
  35. package/dist/SearchableListBase.js.map +1 -1
  36. package/dist/SearchableListBaseTemplate.js +1 -1
  37. package/dist/SearchableListBaseTemplate.js.map +1 -1
  38. package/dist/SelectBase.js +14 -22
  39. package/dist/SelectBase.js.map +1 -1
  40. package/dist/SelectBoxTemplate.js +1 -1
  41. package/dist/SelectBoxTemplate.js.map +1 -1
  42. package/dist/StatusMessage.d.ts +2 -2
  43. package/dist/StatusMessage.js +1 -1
  44. package/dist/StatusMessage.js.map +1 -1
  45. package/dist/TextAreaTemplate.js +1 -1
  46. package/dist/TextAreaTemplate.js.map +1 -1
  47. package/dist/TextFieldTemplate.js +1 -1
  48. package/dist/TextFieldTemplate.js.map +1 -1
  49. package/dist/Upload.js +6 -9
  50. package/dist/Upload.js.map +1 -1
  51. package/dist/UploadItem.d.ts +2 -2
  52. package/dist/UploadItem.js +6 -9
  53. package/dist/UploadItem.js.map +1 -1
  54. package/dist/UploadItemTemplate.d.ts +2 -0
  55. package/dist/UploadItemTemplate.js +14 -0
  56. package/dist/UploadItemTemplate.js.map +1 -0
  57. package/dist/UploadTemplate.d.ts +2 -0
  58. package/dist/UploadTemplate.js +11 -0
  59. package/dist/UploadTemplate.js.map +1 -0
  60. package/dist/assets/{InputSuggestions-DPiJnNLn.js → InputSuggestions-ChhTxYh4.js} +1 -1
  61. package/dist/assets/{ListItemStandardExpandableTextTemplate-B-v72jL6.js → ListItemStandardExpandableTextTemplate-Bh1HxZfH.js} +1 -1
  62. package/dist/assets/{bundle-C7Yft7IG.css → bundle-CdO3MnjQ.css} +1 -1
  63. package/dist/assets/{bundle.esm-DPppjwN7.js → bundle.esm-DCX_ohoZ.js} +253 -241
  64. package/dist/assets/messagebundle_uk-CCv57GhV.js +1 -0
  65. package/dist/css/themes/AccordionItem.css +1 -1
  66. package/dist/css/themes/AccordionSpotlight.css +1 -1
  67. package/dist/css/themes/Avatar.css +1 -1
  68. package/dist/css/themes/CountrySelector.css +1 -1
  69. package/dist/css/themes/EventRibbon.css +1 -1
  70. package/dist/css/themes/FilterMenu.css +1 -1
  71. package/dist/css/themes/HeroBanner.css +1 -1
  72. package/dist/css/themes/ImageGridTicker.css +1 -1
  73. package/dist/css/themes/ListItem.css +1 -1
  74. package/dist/css/themes/MastheadCountrySelector.css +1 -1
  75. package/dist/css/themes/MastheadItem.css +1 -1
  76. package/dist/css/themes/MastheadProfileMenu.css +1 -1
  77. package/dist/css/themes/MastheadShell.css +1 -1
  78. package/dist/css/themes/MediaPlayer.css +1 -1
  79. package/dist/css/themes/Modal.css +1 -1
  80. package/dist/css/themes/PhoneNumberField.css +1 -1
  81. package/dist/css/themes/Search.css +1 -1
  82. package/dist/css/themes/SecondaryNavigationItem.css +1 -1
  83. package/dist/css/themes/SelectBase.css +1 -1
  84. package/dist/css/themes/StepInput.css +1 -1
  85. package/dist/css/themes/TabInOverflow.css +1 -1
  86. package/dist/css/themes/TabNavigation.css +1 -1
  87. package/dist/css/themes/TableCellBase.css +1 -1
  88. package/dist/css/themes/TagGroup.css +1 -1
  89. package/dist/css/themes/TextArea.css +1 -1
  90. package/dist/css/themes/TextField.css +1 -1
  91. package/dist/css/themes/Wizard.css +1 -1
  92. package/dist/custom-elements-internal.json +1138 -117
  93. package/dist/custom-elements.json +740 -123
  94. package/dist/generated/assets/i18n/messagebundle_uk.json +1 -1
  95. package/dist/generated/themes/AccordionItem.css.d.ts +1 -1
  96. package/dist/generated/themes/AccordionItem.css.js +1 -1
  97. package/dist/generated/themes/AccordionItem.css.js.map +1 -1
  98. package/dist/generated/themes/AccordionSpotlight.css.d.ts +1 -1
  99. package/dist/generated/themes/AccordionSpotlight.css.js +1 -1
  100. package/dist/generated/themes/AccordionSpotlight.css.js.map +1 -1
  101. package/dist/generated/themes/Avatar.css.d.ts +1 -1
  102. package/dist/generated/themes/Avatar.css.js +1 -1
  103. package/dist/generated/themes/Avatar.css.js.map +1 -1
  104. package/dist/generated/themes/CountrySelector.css.d.ts +1 -1
  105. package/dist/generated/themes/CountrySelector.css.js +1 -1
  106. package/dist/generated/themes/CountrySelector.css.js.map +1 -1
  107. package/dist/generated/themes/EventRibbon.css.d.ts +1 -1
  108. package/dist/generated/themes/EventRibbon.css.js +1 -1
  109. package/dist/generated/themes/EventRibbon.css.js.map +1 -1
  110. package/dist/generated/themes/FilterMenu.css.d.ts +1 -1
  111. package/dist/generated/themes/FilterMenu.css.js +1 -1
  112. package/dist/generated/themes/FilterMenu.css.js.map +1 -1
  113. package/dist/generated/themes/HeroBanner.css.d.ts +1 -1
  114. package/dist/generated/themes/HeroBanner.css.js +1 -1
  115. package/dist/generated/themes/HeroBanner.css.js.map +1 -1
  116. package/dist/generated/themes/ImageGridTicker.css.d.ts +1 -1
  117. package/dist/generated/themes/ImageGridTicker.css.js +1 -1
  118. package/dist/generated/themes/ImageGridTicker.css.js.map +1 -1
  119. package/dist/generated/themes/ListItem.css.d.ts +1 -1
  120. package/dist/generated/themes/ListItem.css.js +1 -1
  121. package/dist/generated/themes/ListItem.css.js.map +1 -1
  122. package/dist/generated/themes/MastheadCountrySelector.css.d.ts +1 -1
  123. package/dist/generated/themes/MastheadCountrySelector.css.js +1 -1
  124. package/dist/generated/themes/MastheadCountrySelector.css.js.map +1 -1
  125. package/dist/generated/themes/MastheadItem.css.d.ts +1 -1
  126. package/dist/generated/themes/MastheadItem.css.js +1 -1
  127. package/dist/generated/themes/MastheadItem.css.js.map +1 -1
  128. package/dist/generated/themes/MastheadProfileMenu.css.d.ts +1 -1
  129. package/dist/generated/themes/MastheadProfileMenu.css.js +1 -1
  130. package/dist/generated/themes/MastheadProfileMenu.css.js.map +1 -1
  131. package/dist/generated/themes/MastheadShell.css.d.ts +1 -1
  132. package/dist/generated/themes/MastheadShell.css.js +1 -1
  133. package/dist/generated/themes/MastheadShell.css.js.map +1 -1
  134. package/dist/generated/themes/MediaPlayer.css.d.ts +1 -1
  135. package/dist/generated/themes/MediaPlayer.css.js +1 -1
  136. package/dist/generated/themes/MediaPlayer.css.js.map +1 -1
  137. package/dist/generated/themes/Modal.css.d.ts +1 -1
  138. package/dist/generated/themes/Modal.css.js +1 -1
  139. package/dist/generated/themes/Modal.css.js.map +1 -1
  140. package/dist/generated/themes/PhoneNumberField.css.d.ts +1 -1
  141. package/dist/generated/themes/PhoneNumberField.css.js +1 -1
  142. package/dist/generated/themes/PhoneNumberField.css.js.map +1 -1
  143. package/dist/generated/themes/Search.css.d.ts +1 -1
  144. package/dist/generated/themes/Search.css.js +1 -1
  145. package/dist/generated/themes/Search.css.js.map +1 -1
  146. package/dist/generated/themes/SecondaryNavigationItem.css.d.ts +1 -1
  147. package/dist/generated/themes/SecondaryNavigationItem.css.js +1 -1
  148. package/dist/generated/themes/SecondaryNavigationItem.css.js.map +1 -1
  149. package/dist/generated/themes/SelectBase.css.d.ts +1 -1
  150. package/dist/generated/themes/SelectBase.css.js +1 -1
  151. package/dist/generated/themes/SelectBase.css.js.map +1 -1
  152. package/dist/generated/themes/StepInput.css.d.ts +1 -1
  153. package/dist/generated/themes/StepInput.css.js +1 -1
  154. package/dist/generated/themes/StepInput.css.js.map +1 -1
  155. package/dist/generated/themes/TabInOverflow.css.d.ts +1 -1
  156. package/dist/generated/themes/TabInOverflow.css.js +1 -1
  157. package/dist/generated/themes/TabInOverflow.css.js.map +1 -1
  158. package/dist/generated/themes/TabNavigation.css.d.ts +1 -1
  159. package/dist/generated/themes/TabNavigation.css.js +1 -1
  160. package/dist/generated/themes/TabNavigation.css.js.map +1 -1
  161. package/dist/generated/themes/TableCellBase.css.d.ts +1 -1
  162. package/dist/generated/themes/TableCellBase.css.js +1 -1
  163. package/dist/generated/themes/TableCellBase.css.js.map +1 -1
  164. package/dist/generated/themes/TagGroup.css.d.ts +1 -1
  165. package/dist/generated/themes/TagGroup.css.js +1 -1
  166. package/dist/generated/themes/TagGroup.css.js.map +1 -1
  167. package/dist/generated/themes/TextArea.css.d.ts +1 -1
  168. package/dist/generated/themes/TextArea.css.js +1 -1
  169. package/dist/generated/themes/TextArea.css.js.map +1 -1
  170. package/dist/generated/themes/TextField.css.d.ts +1 -1
  171. package/dist/generated/themes/TextField.css.js +1 -1
  172. package/dist/generated/themes/TextField.css.js.map +1 -1
  173. package/dist/generated/themes/Wizard.css.d.ts +1 -1
  174. package/dist/generated/themes/Wizard.css.js +1 -1
  175. package/dist/generated/themes/Wizard.css.js.map +1 -1
  176. package/dist/messagebundle_uk.properties +8 -0
  177. package/dist/utils/searchBackdrop.d.ts +1 -0
  178. package/dist/utils/searchBackdrop.js +23 -0
  179. package/dist/utils/searchBackdrop.js.map +1 -0
  180. package/dist/vscode.html-custom-data.json +165 -2
  181. package/dist/web-types.json +363 -6
  182. package/package.json +1 -1
  183. package/src/CountrySelectorTemplate.tsx +2 -2
  184. package/src/FilterMenu.ts +5 -1
  185. package/src/HeroBanner.ts +66 -0
  186. package/src/List.ts +8 -0
  187. package/src/ListItem.ts +5 -1
  188. package/src/ListTemplate.tsx +1 -1
  189. package/src/MastheadShell.ts +44 -0
  190. package/src/PhoneNumberField.ts +23 -22
  191. package/src/PhoneNumberFieldTemplate.tsx +128 -0
  192. package/src/Search.ts +21 -1
  193. package/src/SearchableListBase.ts +62 -7
  194. package/src/SearchableListBaseTemplate.tsx +1 -0
  195. package/src/SelectBase.ts +14 -21
  196. package/src/SelectBoxTemplate.tsx +1 -1
  197. package/src/StatusMessage.ts +4 -3
  198. package/src/TextAreaTemplate.tsx +1 -1
  199. package/src/TextFieldTemplate.tsx +1 -1
  200. package/src/Upload.ts +7 -10
  201. package/src/UploadItem.ts +7 -9
  202. package/src/UploadItemTemplate.tsx +62 -0
  203. package/src/UploadTemplate.tsx +53 -0
  204. package/src/generated/themes/AccordionItem.css.ts +1 -1
  205. package/src/generated/themes/AccordionSpotlight.css.ts +1 -1
  206. package/src/generated/themes/Avatar.css.ts +1 -1
  207. package/src/generated/themes/CountrySelector.css.ts +1 -1
  208. package/src/generated/themes/EventRibbon.css.ts +1 -1
  209. package/src/generated/themes/FilterMenu.css.ts +1 -1
  210. package/src/generated/themes/HeroBanner.css.ts +1 -1
  211. package/src/generated/themes/ImageGridTicker.css.ts +1 -1
  212. package/src/generated/themes/ListItem.css.ts +1 -1
  213. package/src/generated/themes/MastheadCountrySelector.css.ts +1 -1
  214. package/src/generated/themes/MastheadItem.css.ts +1 -1
  215. package/src/generated/themes/MastheadProfileMenu.css.ts +1 -1
  216. package/src/generated/themes/MastheadShell.css.ts +1 -1
  217. package/src/generated/themes/MediaPlayer.css.ts +1 -1
  218. package/src/generated/themes/Modal.css.ts +1 -1
  219. package/src/generated/themes/PhoneNumberField.css.ts +1 -1
  220. package/src/generated/themes/Search.css.ts +1 -1
  221. package/src/generated/themes/SecondaryNavigationItem.css.ts +1 -1
  222. package/src/generated/themes/SelectBase.css.ts +1 -1
  223. package/src/generated/themes/StepInput.css.ts +1 -1
  224. package/src/generated/themes/TabInOverflow.css.ts +1 -1
  225. package/src/generated/themes/TabNavigation.css.ts +1 -1
  226. package/src/generated/themes/TableCellBase.css.ts +1 -1
  227. package/src/generated/themes/TagGroup.css.ts +1 -1
  228. package/src/generated/themes/TextArea.css.ts +1 -1
  229. package/src/generated/themes/TextField.css.ts +1 -1
  230. package/src/generated/themes/Wizard.css.ts +1 -1
  231. package/src/i18n/messagebundle_uk.properties +8 -0
  232. package/src/themes/AccordionItem.css +1 -1
  233. package/src/themes/AccordionSpotlight.css +1 -1
  234. package/src/themes/Avatar.css +1 -1
  235. package/src/themes/CountrySelector.css +12 -2
  236. package/src/themes/EventRibbon.css +1 -1
  237. package/src/themes/FilterMenu.css +3 -2
  238. package/src/themes/HeroBanner.css +1 -1
  239. package/src/themes/ImageGridTicker.css +1 -1
  240. package/src/themes/ListItem.css +10 -2
  241. package/src/themes/MastheadCountrySelector.css +1 -1
  242. package/src/themes/MastheadItem.css +1 -1
  243. package/src/themes/MastheadProfileMenu.css +1 -1
  244. package/src/themes/MastheadShell.css +1 -1
  245. package/src/themes/MediaPlayer.css +10 -10
  246. package/src/themes/Modal.css +5 -3
  247. package/src/themes/PhoneNumberField.css +16 -6
  248. package/src/themes/Search.css +9 -9
  249. package/src/themes/SecondaryNavigationItem.css +1 -1
  250. package/src/themes/SelectBase.css +2 -2
  251. package/src/themes/StepInput.css +1 -1
  252. package/src/themes/TabInOverflow.css +2 -2
  253. package/src/themes/TabNavigation.css +7 -7
  254. package/src/themes/TableCellBase.css +1 -1
  255. package/src/themes/TagGroup.css +1 -1
  256. package/src/themes/TextArea.css +1 -1
  257. package/src/themes/TextField.css +1 -1
  258. package/src/themes/Wizard.css +1 -1
  259. package/src/utils/searchBackdrop.ts +23 -0
  260. package/dist/assets/messagebundle_uk-GmdhsMsP.js +0 -1
  261. package/dist/generated/templates/PhoneNumberFieldTemplate.lit.d.ts +0 -3
  262. package/dist/generated/templates/PhoneNumberFieldTemplate.lit.js +0 -16
  263. package/dist/generated/templates/PhoneNumberFieldTemplate.lit.js.map +0 -1
  264. package/dist/generated/templates/UploadItemTemplate.lit.d.ts +0 -3
  265. package/dist/generated/templates/UploadItemTemplate.lit.js +0 -12
  266. package/dist/generated/templates/UploadItemTemplate.lit.js.map +0 -1
  267. package/dist/generated/templates/UploadTemplate.lit.d.ts +0 -3
  268. package/dist/generated/templates/UploadTemplate.lit.js +0 -10
  269. package/dist/generated/templates/UploadTemplate.lit.js.map +0 -1
  270. package/src/PhoneNumberField.hbs +0 -119
  271. package/src/Upload.hbs +0 -21
  272. package/src/UploadItem.hbs +0 -32
  273. package/src/generated/templates/PhoneNumberFieldTemplate.lit.ts +0 -20
  274. package/src/generated/templates/UploadItemTemplate.lit.ts +0 -16
  275. package/src/generated/templates/UploadTemplate.lit.ts +0 -14
package/dist/Upload.js CHANGED
@@ -8,22 +8,19 @@ var UDExUpload_1;
8
8
  import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
9
9
  import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
10
10
  import property from "@ui5/webcomponents-base/dist/decorators/property.js";
11
- import { slot } from "@ui5/webcomponents-base/dist/decorators.js";
11
+ import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
12
12
  import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
13
- import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
13
+ import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
14
14
  import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
15
- import FileUploader from "@ui5/webcomponents/dist/FileUploader.js";
16
15
  import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
17
16
  import { UPLOAD_BUTTON_LABEL } from "./generated/i18n/i18n-defaults.js";
18
- import UDExButton from "./Button.js";
19
17
  import UDExButtonSize from "./types/ButtonSize.js";
20
- import UDExList from "./List.js";
21
18
  import UDExUploadItem from "./UploadItem.js";
22
- import UploadTemplate from "./generated/templates/UploadTemplate.lit.js";
19
+ import UploadTemplate from "./UploadTemplate.js";
23
20
  import translate from "./utils/translate.js";
21
+ import { BreakpointUtils } from "./utils/Breakpoints.js";
24
22
  // Styles
25
23
  import UploadCss from "./generated/themes/Upload.css.js";
26
- import { BreakpointUtils } from "./utils/Breakpoints.js";
27
24
  const convertBytesToMegabytes = (bytes) => (bytes / 1024) / 1024;
28
25
  /**
29
26
  * @class
@@ -231,10 +228,10 @@ __decorate([
231
228
  UDExUpload = UDExUpload_1 = __decorate([
232
229
  customElement({
233
230
  tag: "udex-upload",
234
- renderer: litRender,
231
+ renderer: jsxRenderer,
235
232
  styles: UploadCss,
236
233
  template: UploadTemplate,
237
- dependencies: [FileUploader, UDExList, UDExButton, UDExUploadItem],
234
+ dependencies: [UDExUploadItem],
238
235
  })
239
236
  /**
240
237
  * Triggered when the uploaded file exceeds the maximum allowed size.
@@ -1 +1 @@
1
- {"version":3,"file":"Upload.js","sourceRoot":"","sources":["../src/Upload.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAGpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAElE,OAAO,aA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AAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } 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\";\nimport translate from \"./utils/translate.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!: DefaultSlot<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 translate(UDExUpload, 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
+ {"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,IAAI,MAAM,wDAAwD,CAAC;AAE1E,OAAO,aAAa,MAAM,wDAAwD,CAAC;AACnF,OAAO,WAAW,MAAM,iDAAiD,CAAC;AAC1E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAG5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,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AAGnD;IADN,IAAI,CAAC,yBAAyB,CAAC;oCACF;AA7G1B,UAAU;IAhDf,aAAa,CAAC;QACb,GAAG,EAAE,aAAa;QAClB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,cAAc;QACxB,YAAY,EAAE,CAAC,cAAc,CAAC;KAC/B,CAAC;IAEF;;;;;OAKG;;IACF,KAAK,CAAC,kBAAkB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE7C;;;;;OAKG;;IACF,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAExC;;;;;OAKG;;IACF,KAAK,CAAC,aAAa,EAAE,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\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\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/slot-strict.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/renderer/JsxRenderer.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport type 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 UDExButtonSize from \"./types/ButtonSize.js\";\nimport UDExUploadItem from \"./UploadItem.js\";\nimport UploadTemplate from \"./UploadTemplate.js\";\nimport type FileData from \"./types/FileData.js\";\nimport translate from \"./utils/translate.js\";\nimport { BreakpointUtils } from \"./utils/Breakpoints.js\";\n\n// Styles\nimport UploadCss from \"./generated/themes/Upload.css.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: jsxRenderer,\n styles: UploadCss,\n template: UploadTemplate,\n dependencies: [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!: DefaultSlot<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 translate(UDExUpload, 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"]}
@@ -3,7 +3,7 @@ import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
3
3
  import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
4
4
  import { UDExTarget } from "./types/common.js";
5
5
  import UDExListItem from "./ListItem.js";
6
- import UDExLink from "./Link.js";
6
+ import type UDExLink from "./Link.js";
7
7
  import UDExButtonSize from "./types/ButtonSize.js";
8
8
  import UDExFileUploadState from "./types/FileUploadState.js";
9
9
  import type { DefaultSlot } from "@ui5/webcomponents-base/dist/UI5Element.js";
@@ -21,7 +21,7 @@ import type { DefaultSlot } from "@ui5/webcomponents-base/dist/UI5Element.js";
21
21
  * <code>import "@sapudex/web-components/dist/UploadItem.js";</code>
22
22
  *
23
23
  * @constructor
24
- * @extends UDExListItemBase
24
+ * @extends UDExListItem
25
25
  * @public
26
26
  */
27
27
  declare class UDExUploadItem extends UDExListItem {
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var UDExUploadItem_1;
8
8
  import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
9
9
  import property from "@ui5/webcomponents-base/dist/decorators/property.js";
10
- import { slot } from "@ui5/webcomponents-base/dist/decorators.js";
10
+ import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
11
11
  import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
12
- import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
12
+ import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
13
13
  import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
14
14
  import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
15
15
  import { isEnter, isSpace } from "@ui5/webcomponents-base/dist/Keys.js";
@@ -17,11 +17,8 @@ import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
17
17
  import { UDExTarget } from "./types/common.js";
18
18
  import { REMOVE_FILE_TEXT, TERMINATED_FILE_STATUS_TEXT, UPLOADING_FILE_STATUS_TEXT } from "./generated/i18n/i18n-defaults.js";
19
19
  import UDExListItem from "./ListItem.js";
20
- import UDExProgressBar from "./ProgressBar.js";
21
- import UDExLink from "./Link.js";
22
- import UDExButton from "./Button.js";
23
20
  import UDExButtonSize from "./types/ButtonSize.js";
24
- import UploadItemTemplate from "./generated/templates/UploadItemTemplate.lit.js";
21
+ import UploadItemTemplate from "./UploadItemTemplate.js";
25
22
  import translate from "./utils/translate.js";
26
23
  // Styles
27
24
  import UploadItemCss from "./generated/themes/UploadItem.css.js";
@@ -42,7 +39,7 @@ const BreakpointSizeM = 1279;
42
39
  * <code>import "@sapudex/web-components/dist/UploadItem.js";</code>
43
40
  *
44
41
  * @constructor
45
- * @extends UDExListItemBase
42
+ * @extends UDExListItem
46
43
  * @public
47
44
  */
48
45
  let UDExUploadItem = UDExUploadItem_1 = class UDExUploadItem extends UDExListItem {
@@ -158,10 +155,10 @@ __decorate([
158
155
  UDExUploadItem = UDExUploadItem_1 = __decorate([
159
156
  customElement({
160
157
  tag: "udex-upload-item",
161
- renderer: litRender,
158
+ renderer: jsxRenderer,
162
159
  styles: UploadItemCss,
163
160
  template: UploadItemTemplate,
164
- dependencies: [UDExLink, UDExListItem, UDExProgressBar, UDExButton],
161
+ dependencies: [UDExListItem],
165
162
  })
166
163
  /**
167
164
  * Triggered when the upload item is deleted.
@@ -1 +1 @@
1
- {"version":3,"file":"UploadItem.js","sourceRoot":"","sources":["../src/UploadItem.ts"],"names":[],"mappings":";;;;;;;AAAA,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,C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AAQlB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACsB;AAS/C;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDACC;AAS1B;IADD,QAAQ,EAAE;mDAC4D;AAQzB;IAA7C,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;kDAAuC;AASlF;IADD,QAAQ,EAAE;mDACyB;AASlC;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACH;AASvB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACH;AAGlB;IADN,IAAI,CAAC,yBAAyB,CAAC;wCACF;AApF1B,cAAc;IAfnB,aAAa,CAAC;QACb,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,kBAAkB;QAC5B,YAAY,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,CAAC;KACpE,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAErC,cAAc,CAyKnB;AAED,cAAc,CAAC,MAAM,EAAE,CAAC;AAExB,eAAe,cAAc,CAAC","sourcesContent":["import 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 ValueState from \"@ui5/webcomponents-base/dist/types/ValueState.js\";\nimport { isEnter, isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { UDExTarget } from \"./types/common.js\";\nimport { REMOVE_FILE_TEXT, TERMINATED_FILE_STATUS_TEXT, UPLOADING_FILE_STATUS_TEXT } from \"./generated/i18n/i18n-defaults.js\";\nimport UDExListItem from \"./ListItem.js\";\nimport UDExProgressBar from \"./ProgressBar.js\";\nimport UDExLink from \"./Link.js\";\nimport UDExButton from \"./Button.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UploadItemTemplate from \"./generated/templates/UploadItemTemplate.lit.js\";\nimport translate from \"./utils/translate.js\";\n\n// Styles\nimport UploadItemCss from \"./generated/themes/UploadItem.css.js\";\nimport UDExFileUploadState from \"./types/FileUploadState.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\nconst BreakpointSizeS: number = 979;\nconst BreakpointSizeM: number = 1279;\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-item</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/UploadItem.js\";</code>\n *\n * @constructor\n * @extends UDExListItemBase\n * @public\n */\n@customElement({\n tag: \"udex-upload-item\",\n renderer: litRender,\n styles: UploadItemCss,\n template: UploadItemTemplate,\n dependencies: [UDExLink, UDExListItem, UDExProgressBar, UDExButton],\n})\n\n/**\n * Triggered when the upload item is deleted.\n *\n * @public\n */\n@event(\"request-delete\", { bubbles: true })\n\nclass UDExUploadItem extends UDExListItem {\n eventDetails!: {\n \"request-delete\": void\n } & UDExListItem[\"eventDetails\"];\n /**\n * Defines the name of the uploaded file.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n fileName!: string;\n\n /**\n * Defines the link of the uploaded file.\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n fileLink?: string;\n\n /**\n * Defines the file target.\n *\n * @public\n */\n @property({ type: String })\n fileTarget: `${UDExTarget}` = UDExTarget._self;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default 0\n * @public\n */\n @property({ type: Number })\n uploadPercentage!: number;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Uploaded\"\n * @public\n */\n @property()\n uploadState: `${UDExFileUploadState}` = UDExFileUploadState.Uploaded;\n\n /**\n * Slot for information about the uploaded file.\n *\n * @slot\n * @public\n */\n @slot({ type: HTMLElement, \"default\": true }) uploadInfo!: DefaultSlot<HTMLElement>;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Large\"\n * @private\n */\n @property()\n _buttonSize!: `${UDExButtonSize}`;\n\n /**\n * Defines if the screen is at the M breakpoint.\n *\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _breakpointM!: boolean;\n\n /**\n * Defines if the screen is at the L breakpoint.\n *\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _breakpointL!: boolean;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\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 this.fireDecoratorEvent(\"item-press\", {\n selected: false,\n item: this,\n });\n }\n\n onExitDOM(): void {\n ResizeHandler.deregister(this, this._handleResizeBound);\n }\n\n onAfterRendering(): void {\n const fileLink = this.fileLinkComponent;\n if (fileLink) {\n fileLink._setCustomAttributes([{ attribute: \"download\", value: \"true\" }]);\n }\n }\n\n handleButtonClick(e: Event) {\n e.stopImmediatePropagation();\n this.fireDecoratorEvent(\"request-delete\");\n }\n\n handleButtonKeydown(e: KeyboardEvent) {\n if (isEnter(e) || isSpace(e)) {\n e.stopImmediatePropagation();\n this.fireDecoratorEvent(\"request-delete\");\n }\n }\n\n _handleResize() {\n this._buttonSize = window.innerWidth <= BreakpointSizeS ? UDExButtonSize.Medium : UDExButtonSize.Large;\n this._breakpointL = window.innerWidth > BreakpointSizeM;\n this._breakpointM = !this._breakpointL ? true : !this._breakpointL && this.uploadState === UDExFileUploadState.Uploaded;\n }\n\n get fileLinkComponent(): UDExLink {\n return this.shadowRoot!.querySelector<UDExLink>(\"[udex-link]\")!;\n }\n\n get removeButtonAccessibleName(): string {\n return translate(UDExUploadItem, REMOVE_FILE_TEXT);\n }\n\n get showUploadProgress(): boolean {\n return this.uploadState === UDExFileUploadState.Error || this.uploadState === UDExFileUploadState.Uploading;\n }\n\n get uploadProgressState(): ValueState {\n if (this.uploadState === UDExFileUploadState.Uploading) {\n return ValueState.Information;\n }\n\n return ValueState.Negative;\n }\n\n get uploadStatus(): string {\n if (this.uploadState === UDExFileUploadState.Uploading) {\n return `${translate(UDExUploadItem, UPLOADING_FILE_STATUS_TEXT)} ${this.uploadPercentage}%`;\n }\n\n return `${translate(UDExUploadItem, TERMINATED_FILE_STATUS_TEXT)} ${this.uploadPercentage}%`;\n }\n\n get fileInteractive(): boolean {\n return this.uploadState === UDExFileUploadState.Uploaded;\n }\n\n get additionalInfoClasses(): string {\n return `udex-upload-item__info ${this.uploadState === UDExFileUploadState.Error ? \"udex-upload-item__error\" : \"\"}`;\n }\n\n get uploadItemClasses(): string {\n return this.uploadState === \"Uploaded\" ? \"udex-upload-item__info-uploaded\" : \"\";\n }\n}\n\nUDExUploadItem.define();\n\nexport default UDExUploadItem;\n"]}
1
+ {"version":3,"file":"UploadItem.js","sourceRoot":"","sources":["../src/UploadItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAE1E,OAAO,aAAa,MAAM,wDAAwD,CAAC;AACnF,OAAO,WAAW,MAAM,iDAAiD,CAAC;AAC1E,OA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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDACC;AAS1B;IADD,QAAQ,EAAE;mDAC4D;AAQzB;IAA7C,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;kDAAuC;AASlF;IADD,QAAQ,EAAE;mDACyB;AASlC;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACH;AASvB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACH;AAGlB;IADN,IAAI,CAAC,yBAAyB,CAAC;wCACF;AApF1B,cAAc;IAfnB,aAAa,CAAC;QACb,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,kBAAkB;QAC5B,YAAY,EAAE,CAAC,YAAY,CAAC;KAC7B,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAErC,cAAc,CAyKnB;AAED,cAAc,CAAC,MAAM,EAAE,CAAC;AAExB,eAAe,cAAc,CAAC","sourcesContent":["import 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/slot-strict.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/renderer/JsxRenderer.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport ValueState from \"@ui5/webcomponents-base/dist/types/ValueState.js\";\nimport { isEnter, isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { UDExTarget } from \"./types/common.js\";\nimport { REMOVE_FILE_TEXT, TERMINATED_FILE_STATUS_TEXT, UPLOADING_FILE_STATUS_TEXT } from \"./generated/i18n/i18n-defaults.js\";\nimport UDExListItem from \"./ListItem.js\";\nimport type UDExLink from \"./Link.js\";\nimport UDExButtonSize from \"./types/ButtonSize.js\";\nimport UploadItemTemplate from \"./UploadItemTemplate.js\";\nimport translate from \"./utils/translate.js\";\n\n// Styles\nimport UploadItemCss from \"./generated/themes/UploadItem.css.js\";\nimport UDExFileUploadState from \"./types/FileUploadState.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\nconst BreakpointSizeS: number = 979;\nconst BreakpointSizeM: number = 1279;\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-item</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/UploadItem.js\";</code>\n *\n * @constructor\n * @extends UDExListItem\n * @public\n */\n@customElement({\n tag: \"udex-upload-item\",\n renderer: jsxRenderer,\n styles: UploadItemCss,\n template: UploadItemTemplate,\n dependencies: [UDExListItem],\n})\n\n/**\n * Triggered when the upload item is deleted.\n *\n * @public\n */\n@event(\"request-delete\", { bubbles: true })\n\nclass UDExUploadItem extends UDExListItem {\n eventDetails!: {\n \"request-delete\": void\n } & UDExListItem[\"eventDetails\"];\n /**\n * Defines the name of the uploaded file.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n fileName!: string;\n\n /**\n * Defines the link of the uploaded file.\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n fileLink?: string;\n\n /**\n * Defines the file target.\n *\n * @public\n */\n @property({ type: String })\n fileTarget: `${UDExTarget}` = UDExTarget._self;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default 0\n * @public\n */\n @property({ type: Number })\n uploadPercentage!: number;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Uploaded\"\n * @public\n */\n @property()\n uploadState: `${UDExFileUploadState}` = UDExFileUploadState.Uploaded;\n\n /**\n * Slot for information about the uploaded file.\n *\n * @slot\n * @public\n */\n @slot({ type: HTMLElement, \"default\": true }) uploadInfo!: DefaultSlot<HTMLElement>;\n\n /**\n * Defines the percentage of the upload.\n *\n * @default \"Large\"\n * @private\n */\n @property()\n _buttonSize!: `${UDExButtonSize}`;\n\n /**\n * Defines if the screen is at the M breakpoint.\n *\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _breakpointM!: boolean;\n\n /**\n * Defines if the screen is at the L breakpoint.\n *\n * @default false\n * @private\n */\n @property({ type: Boolean })\n _breakpointL!: boolean;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\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 this.fireDecoratorEvent(\"item-press\", {\n selected: false,\n item: this,\n });\n }\n\n onExitDOM(): void {\n ResizeHandler.deregister(this, this._handleResizeBound);\n }\n\n onAfterRendering(): void {\n const fileLink = this.fileLinkComponent;\n if (fileLink) {\n fileLink._setCustomAttributes([{ attribute: \"download\", value: \"true\" }]);\n }\n }\n\n handleButtonClick(e: Event) {\n e.stopImmediatePropagation();\n this.fireDecoratorEvent(\"request-delete\");\n }\n\n handleButtonKeydown(e: KeyboardEvent) {\n if (isEnter(e) || isSpace(e)) {\n e.stopImmediatePropagation();\n this.fireDecoratorEvent(\"request-delete\");\n }\n }\n\n _handleResize() {\n this._buttonSize = window.innerWidth <= BreakpointSizeS ? UDExButtonSize.Medium : UDExButtonSize.Large;\n this._breakpointL = window.innerWidth > BreakpointSizeM;\n this._breakpointM = !this._breakpointL ? true : !this._breakpointL && this.uploadState === UDExFileUploadState.Uploaded;\n }\n\n get fileLinkComponent(): UDExLink {\n return this.shadowRoot!.querySelector<UDExLink>(\"[udex-link]\")!;\n }\n\n get removeButtonAccessibleName(): string {\n return translate(UDExUploadItem, REMOVE_FILE_TEXT);\n }\n\n get showUploadProgress(): boolean {\n return this.uploadState === UDExFileUploadState.Error || this.uploadState === UDExFileUploadState.Uploading;\n }\n\n get uploadProgressState(): ValueState {\n if (this.uploadState === UDExFileUploadState.Uploading) {\n return ValueState.Information;\n }\n\n return ValueState.Negative;\n }\n\n get uploadStatus(): string {\n if (this.uploadState === UDExFileUploadState.Uploading) {\n return `${translate(UDExUploadItem, UPLOADING_FILE_STATUS_TEXT)} ${this.uploadPercentage}%`;\n }\n\n return `${translate(UDExUploadItem, TERMINATED_FILE_STATUS_TEXT)} ${this.uploadPercentage}%`;\n }\n\n get fileInteractive(): boolean {\n return this.uploadState === UDExFileUploadState.Uploaded;\n }\n\n get additionalInfoClasses(): string {\n return `udex-upload-item__info ${this.uploadState === UDExFileUploadState.Error ? \"udex-upload-item__error\" : \"\"}`;\n }\n\n get uploadItemClasses(): string {\n return this.uploadState === \"Uploaded\" ? \"udex-upload-item__info-uploaded\" : \"\";\n }\n}\n\nUDExUploadItem.define();\n\nexport default UDExUploadItem;\n"]}
@@ -0,0 +1,2 @@
1
+ import type UploadItem from "./UploadItem.js";
2
+ export default function UploadItemTemplate(this: UploadItem): import("@ui5/webcomponents-base").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
2
+ import UDExLink from "./Link.js";
3
+ import UDExButton from "./Button.js";
4
+ import UDExProgressBar from "./ProgressBar.js";
5
+ import UDExButtonDesign from "./types/ButtonDesign.js";
6
+ import decline from "@ui5/webcomponents-icons/dist/decline.js";
7
+ export default function UploadItemTemplate() {
8
+ const rootClass = "udex-upload-item";
9
+ return (_jsxs("div", { className: `${rootClass}__wrapper`, children: [_jsxs("div", { className: `${rootClass}__info ${this.uploadItemClasses}`, children: [_jsxs("div", { children: [this.fileInteractive ? (_jsx(UDExLink, { href: this.fileLink, target: this.fileTarget, children: this.fileName })) : (_jsx("p", { className: `${rootClass}__name`, children: this.fileName })), _jsx("div", { className: this.additionalInfoClasses, children: _jsx("slot", {}) })] }), this._breakpointM && deleteButton.call(this)] }), _jsxs("div", { className: `${rootClass}__progress-info-wrapper`, children: [this.showUploadProgress && (_jsxs("div", { className: `${rootClass}__progress-info`, children: [_jsx(UDExProgressBar, { role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.uploadPercentage, value: this.uploadPercentage, "value-state": this.uploadProgressState, "hide-value": true }), _jsx("p", { className: `${rootClass}__progress-status`, children: this.uploadStatus })] })), this._breakpointL && deleteButton.call(this)] })] }));
10
+ }
11
+ function deleteButton() {
12
+ return (_jsx(UDExButton, { "accessible-name": this.removeButtonAccessibleName, onKeyDown: this.handleButtonKeydown, onClick: this.handleButtonClick, size: this._buttonSize, design: UDExButtonDesign.Tertiary, icon: decline }));
13
+ }
14
+ //# sourceMappingURL=UploadItemTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UploadItemTemplate.js","sourceRoot":"","sources":["../src/UploadItemTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,OAAO,MAAM,0CAA0C,CAAC;AAE/D,MAAM,CAAC,OAAO,UAAU,kBAAkB;IACxC,MAAM,SAAS,GAAG,kBAAkB,CAAC;IAErC,OAAO,CACL,eAAK,SAAS,EAAE,GAAG,SAAS,WAAW,aACrC,eAAK,SAAS,EAAE,GAAG,SAAS,UAAU,IAAI,CAAC,iBAAiB,EAAE,aAC5D,0BACG,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CACtB,KAAC,QAAQ,IACP,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,MAAM,EAAE,IAAI,CAAC,UAAU,YACtB,IAAI,CAAC,QAAQ,GACL,CACZ,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAE,GAAG,SAAS,QAAQ,YAAG,IAAI,CAAC,QAAQ,GAAK,CACxD,EACD,cAAK,SAAS,EAAE,IAAI,CAAC,qBAAqB,YACxC,gBAAa,GACT,IACF,EACL,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IACzC,EACN,eAAK,SAAS,EAAE,GAAG,SAAS,yBAAyB,aAClD,IAAI,CAAC,kBAAkB,IAAI,CAC1B,eAAK,SAAS,EAAE,GAAG,SAAS,iBAAiB,aAC3C,KAAC,eAAe,IACd,IAAI,EAAC,aAAa,mBACH,CAAC,mBACD,GAAG,mBACH,IAAI,CAAC,gBAAgB,EACpC,KAAK,EAAE,IAAI,CAAC,gBAAgB,iBACf,IAAI,CAAC,mBAAmB,uBAErB,EAClB,YAAG,SAAS,EAAE,GAAG,SAAS,mBAAmB,YAAG,IAAI,CAAC,YAAY,GAAK,IAClE,CACP,EACA,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IACzC,IACF,CACP,CAAC;AACJ,CAAC;AAED,SAAS,YAAY;IACnB,OAAO,CACL,KAAC,UAAU,uBACQ,IAAI,CAAC,0BAA0B,EAChD,SAAS,EAAE,IAAI,CAAC,mBAAmB,EACnC,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAC/B,IAAI,EAAE,IAAI,CAAC,WAAW,EACtB,MAAM,EAAE,gBAAgB,CAAC,QAAQ,EACjC,IAAI,EAAE,OAAO,GACF,CACd,CAAC;AACJ,CAAC","sourcesContent":["import type UploadItem from \"./UploadItem.js\";\nimport UDExLink from \"./Link.js\";\nimport UDExButton from \"./Button.js\";\nimport UDExProgressBar from \"./ProgressBar.js\";\nimport UDExButtonDesign from \"./types/ButtonDesign.js\";\nimport decline from \"@ui5/webcomponents-icons/dist/decline.js\";\n\nexport default function UploadItemTemplate(this: UploadItem) {\n const rootClass = \"udex-upload-item\";\n\n return (\n <div className={`${rootClass}__wrapper`}>\n <div className={`${rootClass}__info ${this.uploadItemClasses}`}>\n <div>\n {this.fileInteractive ? (\n <UDExLink\n href={this.fileLink}\n target={this.fileTarget}>\n {this.fileName}\n </UDExLink>\n ) : (\n <p className={`${rootClass}__name`}>{this.fileName}</p>\n )}\n <div className={this.additionalInfoClasses}>\n <slot></slot>\n </div>\n </div>\n {this._breakpointM && deleteButton.call(this)}\n </div>\n <div className={`${rootClass}__progress-info-wrapper`}>\n {this.showUploadProgress && (\n <div className={`${rootClass}__progress-info`}>\n <UDExProgressBar\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={this.uploadPercentage}\n value={this.uploadPercentage}\n value-state={this.uploadProgressState}\n hide-value>\n </UDExProgressBar>\n <p className={`${rootClass}__progress-status`}>{this.uploadStatus}</p>\n </div>\n )}\n {this._breakpointL && deleteButton.call(this)}\n </div>\n </div>\n );\n}\n\nfunction deleteButton(this: UploadItem) {\n return (\n <UDExButton\n accessible-name={this.removeButtonAccessibleName}\n onKeyDown={this.handleButtonKeydown}\n onClick={this.handleButtonClick}\n size={this._buttonSize}\n design={UDExButtonDesign.Tertiary}\n icon={decline}>\n </UDExButton>\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type Upload from "./Upload.js";
2
+ export default function UploadTemplate(this: Upload): import("@ui5/webcomponents-base").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
2
+ import FileUploader from "@ui5/webcomponents/dist/FileUploader.js";
3
+ import UDExButton from "./Button.js";
4
+ import UDExList from "./List.js";
5
+ import UDExButtonDesign from "./types/ButtonDesign.js";
6
+ import { UDExListMode } from "./types/List.js";
7
+ export default function UploadTemplate() {
8
+ const rootClass = "udex-upload";
9
+ return (_jsxs("div", { className: `${rootClass}__wrapper`, "onui5-request-delete": this.handleRemoveFile, children: [this.uploadTitle && (_jsx("h1", { className: `${rootClass}__title`, children: this.uploadTitle })), this.additionalText && (_jsx("p", { className: `${rootClass}__additional-text`, children: this.additionalText })), _jsxs("div", { className: `${rootClass}__upload-button-container`, children: [_jsx(FileUploader, { id: "fileUploader", disabled: this.disabled, accept: this.accept, multiple: this.multiple, onChange: this.handleUploadFile, onClick: this.handleUploadClick, "hide-input": true, children: _jsx(UDExButton, { "aria-label": this.uploadButtonAriaLabel, disabled: this.disabled, "aria-disabled": this.disabled, design: UDExButtonDesign.Secondary, size: this._buttonSize, children: this.uploadButtonText }) }), this.showSupportingText && (_jsx("p", { className: this.supportingTextClasses, children: this.supportingText }))] }), _jsx("div", { className: `${rootClass}__files-wrapper`, children: _jsx(UDExList, { mode: UDExListMode.MultiSelect, "aria-busy": this.listBusy, "onui5-selection-change": this.handleSelectionChange, children: _jsx("slot", {}) }) })] }));
10
+ }
11
+ //# sourceMappingURL=UploadTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UploadTemplate.js","sourceRoot":"","sources":["../src/UploadTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,yCAAyC,CAAC;AAEnE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,OAAO,UAAU,cAAc;IACpC,MAAM,SAAS,GAAG,aAAa,CAAC;IAEhC,OAAO,CACL,eACE,SAAS,EAAE,GAAG,SAAS,WAAW,0BACZ,IAAI,CAAC,gBAAgB,aAC1C,IAAI,CAAC,WAAW,IAAI,CACnB,aAAI,SAAS,EAAE,GAAG,SAAS,SAAS,YAAG,IAAI,CAAC,WAAW,GAAM,CAC9D,EACA,IAAI,CAAC,cAAc,IAAI,CACtB,YAAG,SAAS,EAAE,GAAG,SAAS,mBAAmB,YAAG,IAAI,CAAC,cAAc,GAAK,CACzE,EACD,eAAK,SAAS,EAAE,GAAG,SAAS,2BAA2B,aACrD,KAAC,YAAY,IACX,EAAE,EAAC,cAAc,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAC/B,OAAO,EAAE,IAAI,CAAC,iBAAiB,gCAE/B,KAAC,UAAU,kBACG,IAAI,CAAC,qBAAqB,EACtC,QAAQ,EAAE,IAAI,CAAC,QAAQ,mBACR,IAAI,CAAC,QAAQ,EAC5B,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAClC,IAAI,EAAE,IAAI,CAAC,WAAW,YACrB,IAAI,CAAC,gBAAgB,GACX,GACA,EACd,IAAI,CAAC,kBAAkB,IAAI,CAC1B,YAAG,SAAS,EAAE,IAAI,CAAC,qBAAqB,YAAG,IAAI,CAAC,cAAc,GAAK,CACpE,IACG,EACN,cAAK,SAAS,EAAE,GAAG,SAAS,iBAAiB,YAC3C,KAAC,QAAQ,IACP,IAAI,EAAE,YAAY,CAAC,WAAW,eACnB,IAAI,CAAC,QAAQ,4BACA,IAAI,CAAC,qBAAqB,YAClD,gBAAa,GACJ,GACP,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import FileUploader from \"@ui5/webcomponents/dist/FileUploader.js\";\nimport type Upload from \"./Upload.js\";\nimport UDExButton from \"./Button.js\";\nimport UDExList from \"./List.js\";\nimport UDExButtonDesign from \"./types/ButtonDesign.js\";\nimport { UDExListMode } from \"./types/List.js\";\n\nexport default function UploadTemplate(this: Upload) {\n const rootClass = \"udex-upload\";\n\n return (\n <div\n className={`${rootClass}__wrapper`}\n onui5-request-delete={this.handleRemoveFile}>\n {this.uploadTitle && (\n <h1 className={`${rootClass}__title`}>{this.uploadTitle}</h1>\n )}\n {this.additionalText && (\n <p className={`${rootClass}__additional-text`}>{this.additionalText}</p>\n )}\n <div className={`${rootClass}__upload-button-container`}>\n <FileUploader\n id=\"fileUploader\"\n disabled={this.disabled}\n accept={this.accept}\n multiple={this.multiple}\n onChange={this.handleUploadFile}\n onClick={this.handleUploadClick}\n hide-input>\n <UDExButton\n aria-label={this.uploadButtonAriaLabel}\n disabled={this.disabled}\n aria-disabled={this.disabled}\n design={UDExButtonDesign.Secondary}\n size={this._buttonSize}>\n {this.uploadButtonText}\n </UDExButton>\n </FileUploader>\n {this.showSupportingText && (\n <p className={this.supportingTextClasses}>{this.supportingText}</p>\n )}\n </div>\n <div className={`${rootClass}__files-wrapper`}>\n <UDExList\n mode={UDExListMode.MultiSelect}\n aria-busy={this.listBusy}\n onui5-selection-change={this.handleSelectionChange}>\n <slot></slot>\n </UDExList>\n </div>\n </div>\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{p as w,j as l,a as c,f as v,d as y,b as P,s as g,m as x,q as S,r as O,u as R,D as L,c as D,v as A,T as G,I as b,w as I,F as H,B as f,R as V,x as E,z as $,A as N,C as B}from"./bundle.esm-DPppjwN7.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:W},{role:"option"})]}function W(){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})]})})}v("@ui5/webcomponents-theming","sap_horizon",async()=>y);v("@ui5/webcomponents","sap_horizon",async()=>P,"host");const K=`:host([ui5-suggestion-item]){height:auto;min-height:var(--_ui5_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-root{min-height:var(--_ui5_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-content{padding-bottom:.5rem;padding-top:.5rem;box-sizing:border-box}
1
+ import{p as w,j as l,a as c,f as v,d as y,b as P,s as g,m as x,q as S,r as O,u as R,D as L,c as D,v as A,T as G,I as b,w as I,F as H,B as f,R as V,x as E,z as $,A as N,C as B}from"./bundle.esm-DCX_ohoZ.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:W},{role:"option"})]}function W(){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})]})})}v("@ui5/webcomponents-theming","sap_horizon",async()=>y);v("@ui5/webcomponents","sap_horizon",async()=>P,"host");const K=`:host([ui5-suggestion-item]){height:auto;min-height:var(--_ui5_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-root{min-height:var(--_ui5_list_item_base_height)}:host([ui5-suggestion-item]) .ui5-li-content{padding-bottom:.5rem;padding-top:.5rem;box-sizing:border-box}
2
2
  `;var p=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(){O()&&this.setAttribute("desktop","")}get _effectiveTabIndex(){return-1}};p([g()],h.prototype,"text",void 0);p([g()],h.prototype,"additionalText",void 0);p([g()],h.prototype,"markupText",void 0);h=p([x({tag:"ui5-suggestion-item",template:U,styles:[S.styles,K]})],h);h.define();function X(n){const e=(n==null?void 0:n.items)||j;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(R,{focused:this.focused,part:"header",accessibleRole:"Group",wrappingType:this.getGroupHeaderWrapping(),children:this.hasFormattedHeader?l("slot",{name:"header"}):this.headerText}),e.call(this),l(L,{orientation:"Horizontal",ownerReference:this})]})}function j(){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 A{};T([D({default:!0,invalidateOnChildChange:!0,type:HTMLElement})],m.prototype,"items",void 0);m=T([x({tag:"ui5-suggestion-item-group",template:X})],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(V,{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(G,{level:"H1",wrappingType:"None",class:"ui5-responsive-popover-header-text",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:E.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.visibleItems;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.visibleItems,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.component.value=this.component.typedInValue,this.selectedItemIndex-=1;return}this._moveItemSelection(t,--this.selectedItemIndex)}}get visibleItems(){return this._getItems().filter(e=>!e.hidden)}_moveItemSelection(e,t){const s=this.visibleItems,i=s[t],o=s[e],r=this._getNonGroupItems(),a=i==null?void 0:i.hasAttribute("ui5-suggestion-item-group");if(!i)return;this.component.focused=!1;const d=this.visibleItems[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.hasAttribute("ui5-suggestion-item-custom"))&&(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(N)} ${this.accInfo.itemText}`;const e=u.i18nBundle.getText(B,this.accInfo.currentPos||0,this.accInfo.listSize||0);return`${this.accInfo.additionalText} ${e}`.trim()}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 s,a as _,F as T,f as m,d as b,b as E,s as x,c as C,i as P,m as O,y as w,S as B,t as I,E as A,e as S,L as R,R as L,B as M,g as N,h as F,k as z,l as D,n as X,o as j}from"./bundle.esm-DPppjwN7.js";var g;(function(o){o.InPlace="InPlace",o.Popover="Popover"})(g||(g={}));const k=g;var y;(function(o){o.Off="Off",o.On="On"})(y||(y={}));const $=y;function H(){return s(T,{children:s("span",{children:this._renderEmptyIndicator?_(T,{children:[s("span",{className:"empty-indicator","aria-hidden":"true",children:this._emptyIndicatorSymbol}),s("span",{className:"empty-indicator-aria-label",children:this._emptyIndicatorAriaLabel})]}):s("slot",{})})})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E,"host");const W=`:host{max-width:100%;font-size:var(--sapFontSize);font-family:var(--sapFontFamily);color:var(--sapTextColor);line-height:normal;cursor:text;overflow:hidden;display:-webkit-inline-box;-webkit-line-clamp:var(--_ui5_text_max_lines);line-clamp:var(--_ui5_text_max_lines);-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}:host([max-lines="1"]){word-break:break-all}.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 s,a as _,F as T,f as m,d as b,b as E,s as x,c as C,i as P,m as O,y as w,S as B,t as I,E as A,e as S,L as R,R as L,B as M,g as N,h as F,k as z,l as D,n as X,o as j}from"./bundle.esm-DCX_ohoZ.js";var g;(function(o){o.InPlace="InPlace",o.Popover="Popover"})(g||(g={}));const k=g;var y;(function(o){o.Off="Off",o.On="On"})(y||(y={}));const $=y;function H(){return s(T,{children:s("span",{children:this._renderEmptyIndicator?_(T,{children:[s("span",{className:"empty-indicator","aria-hidden":"true",children:this._emptyIndicatorSymbol}),s("span",{className:"empty-indicator-aria-label",children:this._emptyIndicatorAriaLabel})]}):s("slot",{})})})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E,"host");const W=`:host{max-width:100%;font-size:var(--sapFontSize);font-family:var(--sapFontFamily);color:var(--sapTextColor);line-height:normal;cursor:text;overflow:hidden;display:-webkit-inline-box;-webkit-line-clamp:var(--_ui5_text_max_lines);line-clamp:var(--_ui5_text_max_lines);-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}:host([max-lines="1"]){word-break:break-all}.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(o,e,t,i){var r=arguments.length,n=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,i);else for(var d=o.length-1;d>=0;d--)(l=o[d])&&(n=(r<3?l(n):r>3?l(e,t,n):l(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},f;let p=f=class extends B{constructor(){super(...arguments),this.maxLines=1/0,this.emptyIndicatorMode="Off"}onBeforeRendering(){this.style.setProperty("--_ui5_text_max_lines",`${this.maxLines}`)}get hasText(){return I(this.text)}get _renderEmptyIndicator(){return!this.hasText&&this.emptyIndicatorMode===$.On}get _emptyIndicatorAriaLabel(){return f.i18nBundle.getText(A)}get _emptyIndicatorSymbol(){return f.i18nBundle.getText(S)}};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:w,template:H,styles:W})],p);p.define();const v=p;function q(){return _("div",{children:[s(v,{class:"ui5-exp-text-text",emptyIndicatorMode:this.emptyIndicatorMode,children:this._displayedText}),this._maxCharactersExceeded&&_(T,{children:[s("span",{class:"ui5-exp-text-ellipsis",children:this._ellipsisText}),s(R,{id:"toggle",class:"ui5-exp-text-toggle",accessibleRole:"Button",accessibleName:this._accessibleNameForToggle,accessibilityAttributes:this._accessibilityAttributesForToggle,onClick:this._handleToggleClick,children:this._textForToggle}),this._usePopover&&_(L,{open:this._expanded,opener:"toggle",accessibleNameRef:"popover-text",contentOnlyOnDesktop:!0,_hideHeader:!0,class:"ui5-exp-text-popover",onClose:this._handlePopoverClose,children:[s(v,{class:"ui5-exp-text-popover-text",id:"popover-text",children:this.text}),s("div",{slot:"footer",class:"ui5-exp-text-footer",children:s(M,{design:"Transparent",onClick:this._handleCloseButtonClick,children:this._closeButtonText})})]})]})]})}m("@ui5/webcomponents-theming","sap_horizon",async()=>b);m("@ui5/webcomponents","sap_horizon",async()=>E,"host");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;white-space:inherit}.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,.ui5-exp-text-popover-text{white-space:inherit;font-family:inherit;font-size: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(o,e,t,i){var r=arguments.length,n=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,i);else for(var d=o.length-1;d>=0;d--)(l=o[d])&&(n=(r<3?l(n):r>3?l(e,t,n):l(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n},c;let a=c=class extends B{constructor(){super(...arguments),this.maxCharacters=100,this.overflowMode="InPlace",this.emptyIndicatorMode="Off",this._expanded=!1,this._shouldScrollToToggle=!1}getFocusDomRef(){var e,t;return this._usePopover?(e=this.shadowRoot)==null?void 0:e.querySelector("[ui5-responsive-popover]"):(t=this.shadowRoot)==null?void 0:t.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===k.Popover}get _ellipsisText(){return this._expanded&&!this._usePopover?" ":"... "}get _textForToggle(){return this._expanded?c.i18nBundle.getText(N):c.i18nBundle.getText(F)}get _closeButtonText(){return c.i18nBundle.getText(z)}get _accessibilityAttributesForToggle(){return this._usePopover?{expanded:this._expanded,hasPopup:"dialog"}:{expanded:this._expanded}}get _accessibleNameForToggle(){if(this._usePopover)return this._expanded?c.i18nBundle.getText(D):c.i18nBundle.getText(X)}_handlePopoverClose(){j()||(this._expanded=!1)}onAfterRendering(){var e,t;if(this._shouldScrollToToggle){this._shouldScrollToToggle=!1;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("#toggle");(t=i==null?void 0:i.scrollIntoView)==null||t.call(i,{block:"nearest"})}}_handleToggleClick(){this._expanded=!this._expanded,this._expanded&&!this._usePopover&&(this._shouldScrollToToggle=!0)}_handleCloseButtonClick(e){this._expanded=!1,e.stopPropagation()}};h([x()],a.prototype,"text",void 0);h([x({type:Number})],a.prototype,"maxCharacters",void 0);h([x()],a.prototype,"overflowMode",void 0);h([x()],a.prototype,"emptyIndicatorMode",void 0);h([x({type:Boolean})],a.prototype,"_expanded",void 0);h([P("@ui5/webcomponents")],a,"i18nBundle",void 0);a=c=h([O({tag:"ui5-expandable-text",renderer:w,styles:V,template:q})],a);a.define();function K(o){const{className:e,text:t,maxCharacters:i,part:r}=o;return s(a,{part:r,class:e,text:t,maxCharacters:i})}export{K as default};