@mozaic-ds/web-components 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/package.json +3 -3
  2. package/public/ClickOutside-63071e7a.js +1 -15
  3. package/public/ClickOutside-63071e7a.js.map +1 -1
  4. package/public/DataTableDefaultAction.nested-4da4dc44.js +1 -759
  5. package/public/DataTableDefaultAction.nested-4da4dc44.js.map +1 -1
  6. package/public/DataTableUtilities-60220c78.js +1 -370
  7. package/public/DataTableUtilities-60220c78.js.map +1 -1
  8. package/public/EventForward-8492ff62.js +1 -109
  9. package/public/EventForward-8492ff62.js.map +1 -1
  10. package/public/EventHandler-02058705.js +1 -15
  11. package/public/EventHandler-02058705.js.map +1 -1
  12. package/public/adeo/components/checkbox/Checkbox.js +1 -1
  13. package/public/adeo/components/checkbox/Checkbox.js.map +1 -1
  14. package/public/adeo/components/checkbox/Checkbox.svelte +2 -2
  15. package/public/adeo/components/datatable/DataTable.js +1 -1
  16. package/public/adeo/components/datatable/DataTable.js.map +1 -1
  17. package/public/adeo/components/datatable/DataTable.svelte +18 -18
  18. package/public/adeo/components/fileuploader/FileUploader.js +1 -1
  19. package/public/adeo/components/fileuploader/FileUploader.js.map +1 -1
  20. package/public/adeo/components/fileuploader/FileUploader.svelte +8 -5
  21. package/public/adeo/components/fileuploader/ResultFile.nested.js +1 -1
  22. package/public/adeo/components/fileuploader/ResultFile.nested.js.map +1 -1
  23. package/public/adeo/components/layer/Layer.js +1 -1
  24. package/public/adeo/components/layer/Layer.js.map +1 -1
  25. package/public/adeo/components/layer/Layer.svelte +2 -1
  26. package/public/adeo/components/link/Link.js +1 -1
  27. package/public/adeo/components/link/Link.js.map +1 -1
  28. package/public/adeo/components/link/Link.svelte +1 -1
  29. package/public/adeo/components/phonenumber/PhoneNumber.js +1 -1
  30. package/public/adeo/components/phonenumber/PhoneNumber.js.map +1 -1
  31. package/public/adeo/components/phonenumber/PhoneNumber.svelte +72 -9
  32. package/public/adeo/components/quantityselector/QuantitySelector.js +1 -1
  33. package/public/adeo/components/quantityselector/QuantitySelector.js.map +1 -1
  34. package/public/adeo/components/quantityselector/QuantitySelector.svelte +6 -3
  35. package/public/adeo/components/resultfile/ResultFile.nested.svelte +1 -1
  36. package/public/array-5b770a93.js +1 -13
  37. package/public/array-5b770a93.js.map +1 -1
  38. package/public/axis-fbc0f7b5.js +1 -174
  39. package/public/axis-fbc0f7b5.js.map +1 -1
  40. package/public/band-d7a07d2c.js +1 -186
  41. package/public/band-d7a07d2c.js.map +1 -1
  42. package/public/bricoman/components/chart/Donut.js +1 -1
  43. package/public/bricoman/components/checkbox/Checkbox.js +1 -1
  44. package/public/bricoman/components/checkbox/Checkbox.js.map +1 -1
  45. package/public/bricoman/components/checkbox/Checkbox.svelte +2 -2
  46. package/public/bricoman/components/datatable/DataTable.js +1 -1
  47. package/public/bricoman/components/datatable/DataTable.js.map +1 -1
  48. package/public/bricoman/components/datatable/DataTable.svelte +18 -18
  49. package/public/bricoman/components/fileuploader/FileUploader.js +1 -1
  50. package/public/bricoman/components/fileuploader/FileUploader.js.map +1 -1
  51. package/public/bricoman/components/fileuploader/FileUploader.svelte +8 -5
  52. package/public/bricoman/components/fileuploader/ResultFile.nested.js +1 -1
  53. package/public/bricoman/components/fileuploader/ResultFile.nested.js.map +1 -1
  54. package/public/bricoman/components/header/Header.js +1 -1
  55. package/public/bricoman/components/hero/Hero.js +1 -1
  56. package/public/bricoman/components/layer/Layer.js +1 -1
  57. package/public/bricoman/components/layer/Layer.js.map +1 -1
  58. package/public/bricoman/components/layer/Layer.svelte +2 -1
  59. package/public/bricoman/components/link/Link.js +1 -1
  60. package/public/bricoman/components/link/Link.js.map +1 -1
  61. package/public/bricoman/components/link/Link.svelte +1 -1
  62. package/public/bricoman/components/listbox/Listbox.js +1 -1
  63. package/public/bricoman/components/listbox/Listbox.nested.js +1 -1
  64. package/public/bricoman/components/phonenumber/PhoneNumber.js +1 -1
  65. package/public/bricoman/components/phonenumber/PhoneNumber.js.map +1 -1
  66. package/public/bricoman/components/phonenumber/PhoneNumber.svelte +72 -9
  67. package/public/bricoman/components/price/Price.js +1 -1
  68. package/public/bricoman/components/quantityselector/QuantitySelector.js +1 -1
  69. package/public/bricoman/components/quantityselector/QuantitySelector.js.map +1 -1
  70. package/public/bricoman/components/quantityselector/QuantitySelector.svelte +6 -3
  71. package/public/bricoman/components/resultfile/ResultFile.nested.svelte +1 -1
  72. package/public/components/accordion/Accordion.js +1 -365
  73. package/public/components/accordion/Accordion.js.map +1 -1
  74. package/public/components/autocomplete/Autocomplete.js +1 -1515
  75. package/public/components/autocomplete/Autocomplete.js.map +1 -1
  76. package/public/components/badge/Badge.js +1 -155
  77. package/public/components/badge/Badge.js.map +1 -1
  78. package/public/components/badge/Badge.nested.js +1 -101
  79. package/public/components/badge/Badge.nested.js.map +1 -1
  80. package/public/components/breadcrumb/Breadcrumb.js +1 -372
  81. package/public/components/breadcrumb/Breadcrumb.js.map +1 -1
  82. package/public/components/breadcrumb/Breadcrumb.nested.js +1 -319
  83. package/public/components/breadcrumb/Breadcrumb.nested.js.map +1 -1
  84. package/public/components/button/Button.js +1 -1138
  85. package/public/components/button/Button.js.map +1 -1
  86. package/public/components/card/Card.js +1 -369
  87. package/public/components/card/Card.js.map +1 -1
  88. package/public/components/chart/BarChart.js +1 -582
  89. package/public/components/chart/BarChart.js.map +1 -1
  90. package/public/components/chart/Donut.js +1 -1189
  91. package/public/components/chart/Donut.js.map +1 -1
  92. package/public/components/chart/GroupedBarChart.js +1 -750
  93. package/public/components/chart/GroupedBarChart.js.map +1 -1
  94. package/public/components/chart/LineChart.js +1 -1731
  95. package/public/components/chart/LineChart.js.map +1 -1
  96. package/public/components/chart/Radar.js +1 -729
  97. package/public/components/chart/Radar.js.map +1 -1
  98. package/public/components/chart/StackedBarChart.js +1 -745
  99. package/public/components/chart/StackedBarChart.js.map +1 -1
  100. package/public/components/checkbox/Checkbox.js +1 -307
  101. package/public/components/checkbox/Checkbox.js.map +1 -1
  102. package/public/components/checkbox/Checkbox.svelte +2 -2
  103. package/public/components/checkboxgroup/checkboxGroup.js +1 -404
  104. package/public/components/checkboxgroup/checkboxGroup.js.map +1 -1
  105. package/public/components/datatable/DataTable.js +1 -3064
  106. package/public/components/datatable/DataTable.js.map +1 -1
  107. package/public/components/datatable/DataTable.svelte +18 -18
  108. package/public/components/datatable/DataTableDefaultAction.nested.js +1 -4
  109. package/public/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
  110. package/public/components/datatable/DataTableDefaultEdtion.nested.js +1 -164
  111. package/public/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
  112. package/public/components/datatable/DataTableDefaultFilterTags.nested.js +1 -380
  113. package/public/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
  114. package/public/components/datatable/DataTableDefaultSelection.nested.js +1 -424
  115. package/public/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
  116. package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js +1 -263
  117. package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js.map +1 -1
  118. package/public/components/datatable/DataTableFooter.nested.js +1 -637
  119. package/public/components/datatable/DataTableFooter.nested.js.map +1 -1
  120. package/public/components/dropdown/Dropdown.js +1 -1426
  121. package/public/components/dropdown/Dropdown.js.map +1 -1
  122. package/public/components/field/Field.js +1 -375
  123. package/public/components/field/Field.js.map +1 -1
  124. package/public/components/fileuploader/FileUploader.js +1 -555
  125. package/public/components/fileuploader/FileUploader.js.map +1 -1
  126. package/public/components/fileuploader/FileUploader.svelte +8 -5
  127. package/public/components/fileuploader/ResultFile.nested.js +1 -265
  128. package/public/components/fileuploader/ResultFile.nested.js.map +1 -1
  129. package/public/components/flag/Flag.js +1 -174
  130. package/public/components/flag/Flag.js.map +1 -1
  131. package/public/components/header/Header.js +1 -903
  132. package/public/components/header/Header.js.map +1 -1
  133. package/public/components/hero/Hero.js +1 -271
  134. package/public/components/hero/Hero.js.map +1 -1
  135. package/public/components/layer/Layer.js +1 -453
  136. package/public/components/layer/Layer.js.map +1 -1
  137. package/public/components/layer/Layer.svelte +2 -1
  138. package/public/components/link/Link.js +1 -380
  139. package/public/components/link/Link.js.map +1 -1
  140. package/public/components/link/Link.svelte +1 -1
  141. package/public/components/listbox/Listbox.js +1 -595
  142. package/public/components/listbox/Listbox.js.map +1 -1
  143. package/public/components/listbox/Listbox.nested.js +1 -629
  144. package/public/components/listbox/Listbox.nested.js.map +1 -1
  145. package/public/components/loader/Loader.js +1 -246
  146. package/public/components/loader/Loader.js.map +1 -1
  147. package/public/components/loader/Loader.nested.js +1 -176
  148. package/public/components/loader/Loader.nested.js.map +1 -1
  149. package/public/components/modal/Modal.js +1 -395
  150. package/public/components/modal/Modal.js.map +1 -1
  151. package/public/components/notification/Notification.js +1 -458
  152. package/public/components/notification/Notification.js.map +1 -1
  153. package/public/components/optionbutton/OptionButton.js +1 -316
  154. package/public/components/optionbutton/OptionButton.js.map +1 -1
  155. package/public/components/overlay/Overlay.js +1 -104
  156. package/public/components/overlay/Overlay.js.map +1 -1
  157. package/public/components/overlay/OverlayLoader.js +1 -151
  158. package/public/components/overlay/OverlayLoader.js.map +1 -1
  159. package/public/components/pagination/Pagination.js +1 -613
  160. package/public/components/pagination/Pagination.js.map +1 -1
  161. package/public/components/passwordinput/PasswordInput.js +1 -291
  162. package/public/components/passwordinput/PasswordInput.js.map +1 -1
  163. package/public/components/phonenumber/PhoneNumber.js +1 -6894
  164. package/public/components/phonenumber/PhoneNumber.js.map +1 -1
  165. package/public/components/price/Price.js +1 -768
  166. package/public/components/price/Price.js.map +1 -1
  167. package/public/components/progressbar/ProgressBar.js +1 -278
  168. package/public/components/progressbar/ProgressBar.js.map +1 -1
  169. package/public/components/quantityselector/QuantitySelector.js +1 -333
  170. package/public/components/quantityselector/QuantitySelector.js.map +1 -1
  171. package/public/components/quantityselector/QuantitySelector.svelte +6 -3
  172. package/public/components/radio/Radio.js +1 -273
  173. package/public/components/radio/Radio.js.map +1 -1
  174. package/public/components/radiogroup/RadioGroup.js +1 -414
  175. package/public/components/radiogroup/RadioGroup.js.map +1 -1
  176. package/public/components/ratings/StarsInput.js +1 -292
  177. package/public/components/ratings/StarsInput.js.map +1 -1
  178. package/public/components/ratings/StarsResult.js +1 -246
  179. package/public/components/ratings/StarsResult.js.map +1 -1
  180. package/public/components/resultfile/ResultFile.nested.svelte +1 -1
  181. package/public/components/select/Select.js +1 -451
  182. package/public/components/select/Select.js.map +1 -1
  183. package/public/components/sidebar/Sidebar.js +1 -784
  184. package/public/components/sidebar/Sidebar.js.map +1 -1
  185. package/public/components/sidebar/sidebar-feature-group.nested.js +1 -594
  186. package/public/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
  187. package/public/components/sidebar/sidebar-feature.nested.js +1 -402
  188. package/public/components/sidebar/sidebar-feature.nested.js.map +1 -1
  189. package/public/components/sidebar/sidebar-section.nested.js +1 -394
  190. package/public/components/sidebar/sidebar-section.nested.js.map +1 -1
  191. package/public/components/sidebar/sidebar-segment.nested.js +1 -200
  192. package/public/components/sidebar/sidebar-segment.nested.js.map +1 -1
  193. package/public/components/sidebar/sidebar-separator.nested.js +1 -49
  194. package/public/components/sidebar/sidebar-separator.nested.js.map +1 -1
  195. package/public/components/sidebar/sidebar-sub-features.nested.js +1 -312
  196. package/public/components/sidebar/sidebar-sub-features.nested.js.map +1 -1
  197. package/public/components/sidebar/sidebar-user.nested.js +1 -733
  198. package/public/components/sidebar/sidebar-user.nested.js.map +1 -1
  199. package/public/components/stepper/Stepper.js +1 -371
  200. package/public/components/stepper/Stepper.js.map +1 -1
  201. package/public/components/tabs/Tabs.js +1 -615
  202. package/public/components/tabs/Tabs.js.map +1 -1
  203. package/public/components/tabs/Tabs.nested.js +1 -472
  204. package/public/components/tabs/Tabs.nested.js.map +1 -1
  205. package/public/components/tag/Tag.js +1 -665
  206. package/public/components/tag/Tag.js.map +1 -1
  207. package/public/components/tag/Tag.nested.js +1 -554
  208. package/public/components/tag/Tag.nested.js.map +1 -1
  209. package/public/components/taglist/TagList.js +1 -475
  210. package/public/components/taglist/TagList.js.map +1 -1
  211. package/public/components/textarea/Textarea.js +1 -303
  212. package/public/components/textarea/Textarea.js.map +1 -1
  213. package/public/components/textinput/Textinput.js +1 -497
  214. package/public/components/textinput/Textinput.js.map +1 -1
  215. package/public/components/textinput/Textinput.nested.js +1 -320
  216. package/public/components/textinput/Textinput.nested.js.map +1 -1
  217. package/public/components/toggle/Toggle.js +1 -278
  218. package/public/components/toggle/Toggle.js.map +1 -1
  219. package/public/components/tooltip/Tooltip.js +1 -173
  220. package/public/components/tooltip/Tooltip.js.map +1 -1
  221. package/public/index-c33b3772.js +1 -873
  222. package/public/index-c33b3772.js.map +1 -1
  223. package/public/linear-f46d7e9e.js +1 -700
  224. package/public/linear-f46d7e9e.js.map +1 -1
  225. package/public/path-1b5da959.js +1 -186
  226. package/public/path-1b5da959.js.map +1 -1
  227. package/public/sidebar-service-275bf9ef.js +1 -129
  228. package/public/sidebar-service-275bf9ef.js.map +1 -1
  229. package/public/symbol-b05a6e2b.js +1 -169
  230. package/public/symbol-b05a6e2b.js.map +1 -1
  231. package/public/transform-15d69d5d.js +1 -2743
  232. package/public/transform-15d69d5d.js.map +1 -1
  233. package/public/utilities/stories/fileuploader/FileUploader.stories.d.ts.map +1 -1
  234. package/public/utilities/stories/quantityselector/QuantitySelector.stories.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploader.js","sources":["../../../../src/components/fileuploader/FileUploader.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n // @ts-nocheck\n import { EventHandler } from '../../utilities/EventHandler';\n import ResultFile from './ResultFile.nested.svelte';\n\n export let id: string;\n export let label: string;\n export let accept: string;\n export let multiple = true;\n export let allowedextensions: string;\n export let maxsize: number;\n export let displayfileslist = false;\n export let disabled = false;\n export let removelabel = 'Remove';\n export let uploadedfiles: string;\n\n let files: FileList;\n let root: HTMLElement;\n let eventHandler = new EventHandler();\n\n $: allowedExtensions = allowedextensions ? JSON.parse(allowedextensions) : [];\n $: uploadedFiles = uploadedfiles ? JSON.parse(uploadedfiles) : [];\n $: files;\n $: maxSize = maxsize ? maxsize : undefined;\n\n function checkFileSize(fileSize: number): boolean {\n const fileSizeMB = fileSize / 1024 / 1024; // in MB\n if (maxSize && fileSizeMB > maxSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n function checkFileExtension(fileName: string): boolean {\n if (allowedExtensions && allowedExtensions.length > 0) {\n const extension: string = fileName.slice(\n ((fileName.lastIndexOf('.') - 1) >>> 0) + 2,\n );\n if (allowedExtensions && !allowedExtensions.includes(String(extension))) {\n return false; // invalid\n }\n }\n\n return true; // valid\n }\n\n function checkFileStatus(file: File): boolean {\n const validExtension = allowedExtensions\n ? checkFileExtension(file.name)\n : true;\n const validSize = checkFileSize(file.size);\n\n if (!validExtension || !validSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n function handleChange(e: Event): void {\n const target = e.target as HTMLInputElement;\n files = target.files as FileList;\n displayfileslist = true;\n const invalidFiles: Array = [];\n const fileList = [...files];\n fileList.forEach((file, index) => {\n const fileName = file.name;\n const fileSize = file.size;\n const validExtension = checkFileExtension(fileName);\n const validSize = checkFileSize(fileSize);\n let errorType = '';\n\n if (!validExtension) {\n errorType = 'invalid-extension';\n }\n\n if (!validSize) {\n errorType = 'invalid-size';\n }\n\n if (!validExtension || !validSize) {\n invalidFiles.push({\n index: index,\n fileName: fileName,\n fileSize: fileSize,\n errorType: errorType,\n });\n }\n });\n\n if (invalidFiles.length > 0) {\n eventHandler.dispatch('invalid-files', invalidFiles);\n }\n eventHandler.dispatch('change', files);\n }\n\n function removeFromArray(fileList: FileList, value: File): FileList {\n const array = Array.from(fileList);\n const idx = array.indexOf(value);\n if (idx !== -1) {\n array.splice(idx, 1);\n }\n return array as FileList;\n }\n\n function deleteFile(e: CustomEvent): void {\n files = [...uploadedFiles];\n files = removeFromArray(files, e.detail);\n const fileuploader = root.querySelector(\n '.mc-fileuploader__input',\n ) as HTMLInputElement;\n fileuploader.value = '';\n uploadedFiles = files;\n eventHandler.dispatch('file-removed', e.detail);\n }\n\n function hasInvalidFiles(e: CustomEvent): void {\n eventHandler.dispatch('invalid-files', e.detail);\n }\n</script>\n\n<div class=\"mc-fileuploader\" bind:this={root}>\n <input\n {id}\n type=\"file\"\n class=\"mc-fileuploader__input\"\n {accept}\n {multiple}\n {disabled}\n on:change={handleChange}\n />\n <label for={id} class=\"mc-fileuploader__label\">\n <span class=\"mc-fileuploader__label--center\">\n {label}\n </span>\n </label>\n {#if displayfileslist && files.length > 0}\n <ResultFile\n {files}\n {allowedExtensions}\n {disabled}\n {maxSize}\n {removelabel}\n on:file-removed={deleteFile}\n />\n {/if}\n {#if uploadedFiles.length > 0}\n <ResultFile\n files={uploadedFiles}\n {allowedExtensions}\n {disabled}\n {maxSize}\n {removelabel}\n on:file-removed={deleteFile}\n />\n {/if}\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n @import '@mozaic-ds/styles/components/c.file-uploader';\n</style>\n"],"names":["ctx","if_block0","length","create_if_block_1","create_if_block","insert","target","div","anchor","append","input","label_1","span","files","root","id","$$props","label","accept","multiple","allowedextensions","maxsize","displayfileslist","disabled","removelabel","uploadedfiles","eventHandler","EventHandler","$$invalidate","allowedExtensions","JSON","parse","uploadedFiles","maxSize","undefined","e","invalidFiles","forEach","file","index","fileName","name","fileSize","size","validExtension","extension","slice","lastIndexOf","includes","String","checkFileExtension","validSize","checkFileSize","errorType","push","dispatch","fileList","value","array","Array","from","idx","indexOf","splice","removeFromArray","detail","querySelector","$$value"],"mappings":"+aAgJuBA,EAAU,wVAKpBA,EAAa,gGAKHA,EAAU,oFALpBA,EAAa,uPAZnBC,EAAAD,EAAoB,IAAAA,EAAM,GAAAE,OAAS,GAACC,EAAAH,KAUpCA,EAAa,GAACE,OAAS,GAACE,EAAAJ,yEAbxBA,EAAK,8NAFEA,EAAE,iFAVhBK,EAmCKC,EAAAC,EAAAC,GAlCHC,EAQCF,EAAAG,UACDD,EAIOF,EAAAI,GAHLF,EAEME,EAAAC,uFALKZ,EAAY,wJAIpBA,EAAK,yBAFEA,EAAE,IAKTA,EAAoB,IAAAA,EAAM,GAAAE,OAAS,iGAUnCF,EAAa,GAACE,OAAS,sOAjIxBW,EACAC,MAZOC,GAAUC,SACVC,GAAaD,UACbE,GAAcF,GACdG,SAAAA,GAAW,GAAIH,qBACfI,GAAyBJ,WACzBK,GAAeL,GACfM,iBAAAA,GAAmB,GAAKN,GACxBO,SAAAA,GAAW,GAAKP,GAChBQ,YAAAA,EAAc,UAAQR,iBACtBS,GAAqBT,EAI5BU,MAAmBC,0aAEtBC,EAAA,GAAEC,EAAoBT,EAAoBU,KAAKC,MAAMX,GAAiB,sBACtEQ,EAAA,EAAEI,EAAgBP,EAAgBK,KAAKC,MAAMN,GAAa,sCAExDQ,EAAUZ,QAAoBa,6BAmCxB,SAAaC,SACd7B,EAAS6B,EAAE7B,WACjBO,EAAQP,EAAOO,OACfe,EAAA,EAAAN,GAAmB,SACbc,EAAY,OACGvB,GACZwB,SAAS,CAAAC,EAAMC,WAChBC,EAAWF,EAAKG,KAChBC,EAAWJ,EAAKK,KAChBC,EAlCD,SAAmBJ,GACtB,GAAAX,GAAqBA,EAAkB3B,OAAS,EAAC,CAC7C,MAAA2C,EAAoBL,EAASM,MACS,GAAxCN,EAASO,YAAY,KAAO,IAAO,IAEnC,GAAAlB,IAAsBA,EAAkBmB,SAASC,OAAOJ,WACnD,SAIJ,EAwBkBK,CAAmBV,GACpCW,EA3CD,SAAcT,WAEjBT,GADeS,EAAW,KAAO,KACTT,GAyCRmB,CAAcV,GAC5B,IAAAW,EAAY,GAEXT,IACHS,EAAY,qBAGTF,IACHE,EAAY,gBAGTT,GAAmBO,GACtBf,EAAakB,KACJ,CAAAf,QACGC,WACAE,WACCW,iBAKbjB,EAAalC,OAAS,GACxBwB,EAAa6B,SAAS,gBAAiBnB,GAEzCV,EAAa6B,SAAS,SAAU1C,IAYzB,SAAWsB,GAClBP,EAAA,EAAAf,MAAYmB,IACZJ,EAAA,EAAAf,WAXuB2C,EAAoBC,GACrC,MAAAC,EAAQC,MAAMC,KAAKJ,GACnBK,EAAMH,EAAMI,QAAQL,UACb,IAATI,GACFH,EAAMK,OAAOF,EAAK,GAEbH,EAKCM,CAAgBnD,EAAOsB,EAAE8B,SACZnD,EAAKoD,cACxB,2BAEWT,MAAQ,GACrB7B,EAAA,EAAAI,EAAgBnB,GAChBa,EAAa6B,SAAS,eAAgBpB,EAAE8B,uDAQJnD,EAAIqD"}
1
+ {"version":3,"file":"FileUploader.js","sources":["../../../../src/components/fileuploader/FileUploader.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n // @ts-nocheck\n import { EventHandler } from '../../utilities/EventHandler';\n import ResultFile from './ResultFile.nested.svelte';\n\n export let id: string;\n export let label: string;\n export let accept: string;\n export let multiple = true;\n export let allowedextensions: string;\n export let maxsize: number;\n export let displayfileslist = false;\n export let disabled = false;\n export let removelabel = 'Remove';\n export let uploadedfiles: string;\n\n let files: FileList;\n let root: HTMLElement;\n let eventHandler = new EventHandler();\n\n $: allowedExtensions = allowedextensions ? JSON.parse(allowedextensions) : [];\n $: uploadedFiles = uploadedfiles ? JSON.parse(uploadedfiles) : [];\n $: files;\n $: maxSize = maxsize ? maxsize : undefined;\n\n function checkFileSize(fileSize: number): boolean {\n const fileSizeMB = fileSize / 1024 / 1024; // in MB\n if (maxSize && fileSizeMB > maxSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n function checkFileExtension(fileName: string): boolean {\n if (allowedExtensions && allowedExtensions.length > 0) {\n const extension: string = fileName.slice(\n ((fileName.lastIndexOf('.') - 1) >>> 0) + 2,\n );\n if (allowedExtensions && !allowedExtensions.includes(String(extension))) {\n return false; // invalid\n }\n }\n\n return true; // valid\n }\n\n function checkFileStatus(file: File): boolean {\n const validExtension = allowedExtensions\n ? checkFileExtension(file.name)\n : true;\n const validSize = checkFileSize(file.size);\n\n if (!validExtension || !validSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n function handleChange(e: Event): void {\n const target = e.target as HTMLInputElement;\n files = target.files as FileList;\n displayfileslist = true;\n const invalidFiles: Array = [];\n fileList.forEach((file, index) => {\n const fileName = file.name;\n const fileSize = file.size;\n const validExtension = checkFileExtension(fileName);\n const validSize = checkFileSize(fileSize);\n let errorType = '';\n\n if (!validExtension) {\n errorType = 'invalid-extension';\n }\n\n if (!validSize) {\n errorType = 'invalid-size';\n }\n\n if (!validExtension || !validSize) {\n invalidFiles.push({\n index: index,\n fileName: fileName,\n fileSize: fileSize,\n errorType: errorType,\n });\n }\n });\n\n if (invalidFiles.length > 0) {\n eventHandler.dispatch('invalid-files', invalidFiles);\n }\n eventHandler.dispatch('change', files);\n }\n\n function removeFromArray(fileList: FileList, value: File): FileList {\n const array = Array.from(fileList);\n const idx = array.indexOf(value);\n if (idx !== -1) {\n array.splice(idx, 1);\n }\n return array as FileList;\n }\n\n function deleteFile(e: CustomEvent): void {\n files = removeFromArray(files, e.detail);\n const fileuploader = root.querySelector(\n '.mc-fileuploader__input',\n ) as HTMLInputElement;\n fileuploader.value = '';\n eventHandler.dispatch('file-removed', e.detail);\n }\n\n function deleteUploadedFile(e: CustomEvent): void {\n const files = removeFromArray(uploadedFiles, e.detail);\n uploadedFiles = files;\n eventHandler.dispatch('uploaded-file-removed', e.detail);\n }\n\n function hasInvalidFiles(e: CustomEvent): void {\n eventHandler.dispatch('invalid-files', e.detail);\n }\n</script>\n\n<div class=\"mc-fileuploader\" bind:this={root}>\n <input\n {id}\n type=\"file\"\n class=\"mc-fileuploader__input\"\n {accept}\n {multiple}\n {disabled}\n on:change={handleChange}\n />\n <label for={id} class=\"mc-fileuploader__label\">\n <span class=\"mc-fileuploader__label--center\">\n {label}\n </span>\n </label>\n {#if displayfileslist && files && files.length > 0}\n <ResultFile\n {files}\n {allowedExtensions}\n {disabled}\n {maxSize}\n {removelabel}\n on:file-removed={deleteFile}\n />\n {/if}\n {#if uploadedFiles.length > 0}\n <ResultFile\n files={uploadedFiles}\n {allowedExtensions}\n {disabled}\n {maxSize}\n {removelabel}\n on:file-removed={deleteUploadedFile}\n />\n {/if}\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n @import '@mozaic-ds/styles/components/c.file-uploader';\n</style>\n"],"names":["ctx","if_block0","length","create_if_block_1","create_if_block","insert","target","div","anchor","append","input","label_1","span","removeFromArray","fileList","value","array","Array","from","idx","indexOf","splice","files","root","id","$$props","label","accept","multiple","allowedextensions","maxsize","displayfileslist","disabled","removelabel","uploadedfiles","eventHandler","EventHandler","$$invalidate","allowedExtensions","JSON","parse","uploadedFiles","maxSize","undefined","e","invalidFiles","forEach","file","index","fileName","name","fileSize","size","validExtension","extension","slice","lastIndexOf","includes","String","checkFileExtension","validSize","checkFileSize","errorType","push","dispatch","detail","querySelector","$$value"],"mappings":"+aAmJuBA,EAAU,wVAKpBA,EAAa,gGAKHA,EAAkB,oFAL5BA,EAAa,uPAZnBC,EAAAD,MAAoBA,EAAK,IAAIA,EAAM,GAAAE,OAAS,GAACC,EAAAH,KAU7CA,EAAa,GAACE,OAAS,GAACE,EAAAJ,yEAbxBA,EAAK,8NAFEA,EAAE,iFAVhBK,EAmCKC,EAAAC,EAAAC,GAlCHC,EAQCF,EAAAG,UACDD,EAIOF,EAAAI,GAHLF,EAEME,EAAAC,uFALKZ,EAAY,wJAIpBA,EAAK,yBAFEA,EAAE,IAKTA,MAAoBA,EAAK,IAAIA,EAAM,GAAAE,OAAS,iGAU5CF,EAAa,GAACE,OAAS,mNAtDnBW,EAAgBC,EAAoBC,GACrC,MAAAC,EAAQC,MAAMC,KAAKJ,GACnBK,EAAMH,EAAMI,QAAQL,UACb,IAATI,GACFH,EAAMK,OAAOF,EAAK,GAEbH,8BApFLM,EACAC,MAZOC,GAAUC,SACVC,GAAaD,UACbE,GAAcF,GACdG,SAAAA,GAAW,GAAIH,qBACfI,GAAyBJ,WACzBK,GAAeL,GACfM,iBAAAA,GAAmB,GAAKN,GACxBO,SAAAA,GAAW,GAAKP,GAChBQ,YAAAA,EAAc,UAAQR,iBACtBS,GAAqBT,EAI5BU,MAAmBC,0aAEtBC,EAAA,GAAEC,EAAoBT,EAAoBU,KAAKC,MAAMX,GAAiB,uBACtEQ,EAAA,EAAEI,EAAgBP,EAAgBK,KAAKC,MAAMN,GAAa,sCAExDQ,EAAUZ,QAAoBa,6BAmCxB,SAAaC,SACdtC,EAASsC,EAAEtC,WACjBgB,EAAQhB,EAAOgB,OACfe,EAAA,EAAAN,GAAmB,SACbc,EAAY,GAClB/B,SAASgC,SAAS,CAAAC,EAAMC,WAChBC,EAAWF,EAAKG,KAChBC,EAAWJ,EAAKK,KAChBC,EAjCD,SAAmBJ,GACtB,GAAAX,GAAqBA,EAAkBpC,OAAS,EAAC,CAC7C,MAAAoD,EAAoBL,EAASM,MACS,GAAxCN,EAASO,YAAY,KAAO,IAAO,IAEnC,GAAAlB,IAAsBA,EAAkBmB,SAASC,OAAOJ,WACnD,SAIJ,EAuBkBK,CAAmBV,GACpCW,EA1CD,SAAcT,WAEjBT,GADeS,EAAW,KAAO,KACTT,GAwCRmB,CAAcV,GAC5B,IAAAW,EAAY,GAEXT,IACHS,EAAY,qBAGTF,IACHE,EAAY,gBAGTT,GAAmBO,GACtBf,EAAakB,KACJ,CAAAf,QACGC,WACAE,WACCW,iBAKbjB,EAAa3C,OAAS,GACxBiC,EAAa6B,SAAS,gBAAiBnB,GAEzCV,EAAa6B,SAAS,SAAU1C,IAYzB,SAAWsB,GAClBP,EAAA,EAAAf,EAAQT,EAAgBS,EAAOsB,EAAEqB,SACZ1C,EAAK2C,cACxB,2BAEWnD,MAAQ,GACrBoB,EAAa6B,SAAS,eAAgBpB,EAAEqB,SAGjC,SAAmBrB,GACpB,MAAAtB,EAAQT,EAAgB4B,EAAeG,EAAEqB,QAC/C5B,EAAA,EAAAI,EAAgBnB,GAChBa,EAAa6B,SAAS,wBAAyBpB,EAAEqB,uDAQb1C,EAAI4C"}
@@ -63,7 +63,6 @@
63
63
  files = target.files as FileList;
64
64
  displayfileslist = true;
65
65
  const invalidFiles: Array = [];
66
- const fileList = [...files];
67
66
  fileList.forEach((file, index) => {
68
67
  const fileName = file.name;
69
68
  const fileSize = file.size;
@@ -105,16 +104,20 @@
105
104
  }
106
105
 
107
106
  function deleteFile(e: CustomEvent): void {
108
- files = [...uploadedFiles];
109
107
  files = removeFromArray(files, e.detail);
110
108
  const fileuploader = root.querySelector(
111
109
  '.mc-fileuploader__input',
112
110
  ) as HTMLInputElement;
113
111
  fileuploader.value = '';
114
- uploadedFiles = files;
115
112
  eventHandler.dispatch('file-removed', e.detail);
116
113
  }
117
114
 
115
+ function deleteUploadedFile(e: CustomEvent): void {
116
+ const files = removeFromArray(uploadedFiles, e.detail);
117
+ uploadedFiles = files;
118
+ eventHandler.dispatch('uploaded-file-removed', e.detail);
119
+ }
120
+
118
121
  function hasInvalidFiles(e: CustomEvent): void {
119
122
  eventHandler.dispatch('invalid-files', e.detail);
120
123
  }
@@ -135,7 +138,7 @@
135
138
  {label}
136
139
  </span>
137
140
  </label>
138
- {#if displayfileslist && files.length > 0}
141
+ {#if displayfileslist && files && files.length > 0}
139
142
  <ResultFile
140
143
  {files}
141
144
  {allowedExtensions}
@@ -152,7 +155,7 @@
152
155
  {disabled}
153
156
  {maxSize}
154
157
  {removelabel}
155
- on:file-removed={deleteFile}
158
+ on:file-removed={deleteUploadedFile}
156
159
  />
157
160
  {/if}
158
161
  </div>
@@ -1,2 +1,2 @@
1
- import{P as e,i as s,s as l,Q as i,e as t,g as o,b as a,n as r,o as n,J as M,c,q as d,t as w,d as m,j as g,l as u,k as f}from"../../index-c33b3772.js";import{E as x}from"../../EventHandler-02058705.js";function b(e){i(e,"svelte-zs822y",'.mc-fileuploader.svelte-zs822y.svelte-zs822y{position:relative;display:block}.mc-fileuploader__input.svelte-zs822y.svelte-zs822y{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;visibility:visible;white-space:nowrap}.mc-fileuploader__label.svelte-zs822y.svelte-zs822y{font-family:"Roboto", sans-serif;font-weight:700;cursor:pointer;border-radius:4px;text-align:center;border:2px solid transparent;-webkit-transition:all ease 200ms;-o-transition:all ease 200ms;transition:all ease 200ms;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem;color:#007f8c;border-color:#007f8c;background-color:#ffffff;margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;-webkit-box-sizing:border-box;box-sizing:border-box}.mc-fileuploader__label.is-hover.svelte-zs822y.svelte-zs822y,.mc-fileuploader__label.svelte-zs822y.svelte-zs822y:hover{background-color:#d9f0f3;color:#006974}.mc-fileuploader__label.is-active.svelte-zs822y.svelte-zs822y,.mc-fileuploader__label.svelte-zs822y.svelte-zs822y:active{background-color:#91d5db;color:#004e57}.mc-fileuploader__label.is-active.svelte-zs822y.svelte-zs822y,.mc-fileuploader__label.svelte-zs822y.svelte-zs822y:active{background-color:#91d5db;color:#004e57}.mc-fileuploader__label.svelte-zs822y.svelte-zs822y:disabled,.mc-fileuploader__label.is-disabled.svelte-zs822y.svelte-zs822y{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-fileuploader__label.svelte-zs822y.svelte-zs822y::before{content:"";width:1.5rem;height:1.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjMDA3ZjhjIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjx0aXRsZT5NZWRpYV9VcGxvYWRfMjRweDwvdGl0bGU+PHBhdGggZD0iTTguNzEsNy43MSwxMSw1LjQxVjE2YTEsMSwwLDAsMCwyLDBWNS40MWwyLjI5LDIuM2ExLDEsMCwwLDAsMS40MiwwLDEsMSwwLDAsMCwwLTEuNDJsLTQtNGExLDEsMCwwLDAtMS40MiwwbC00LDRBMSwxLDAsMSwwLDguNzEsNy43MVoiLz48cGF0aCBkPSJNMTYuMjIsMTIuNDRhMSwxLDAsMCwwLTEuMi43NywxLDEsMCwwLDAsLjc2LDEuMTlDMTguNTUsMTUsMjAsMTYuMTcsMjAsMTdjMCwxLjIyLTMuMTIsMy04LDNzLTgtMS43OC04LTNjMC0uODMsMS40NS0yLDQuMjItMi42QTEsMSwwLDAsMCw5LDEzLjIxYTEsMSwwLDAsMC0xLjItLjc3QzQuMTYsMTMuMjUsMiwxNSwyLDE3YzAsMi44NSw0LjMsNSwxMCw1czEwLTIuMTUsMTAtNUMyMiwxNSwxOS44NCwxMy4yNSwxNi4yMiwxMi40NFoiLz48L3N2Zz4=") no-repeat;background-size:1.5rem;margin-right:0.5rem;margin-left:-0.5rem}.is-focus.svelte-zs822y+.mc-fileuploader__label.svelte-zs822y,.svelte-zs822y:focus+.mc-fileuploader__label.svelte-zs822y{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.is-hover.svelte-zs822y+.mc-fileuploader__label.svelte-zs822y,.svelte-zs822y:hover+.mc-fileuploader__label.svelte-zs822y{color:#006974;background-color:#d9f0f3}.is-disabled.svelte-zs822y+.mc-fileuploader__label.svelte-zs822y,.svelte-zs822y:disabled+.mc-fileuploader__label.svelte-zs822y{color:#666666;background-color:#cccccc;border-color:transparent;cursor:not-allowed}.is-disabled.svelte-zs822y+.mc-fileuploader__label.svelte-zs822y::before,.svelte-zs822y:disabled+.mc-fileuploader__label.svelte-zs822y::before{background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjNjY2NjY2IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjx0aXRsZT5NZWRpYV9VcGxvYWRfMjRweDwvdGl0bGU+PHBhdGggZD0iTTguNzEsNy43MSwxMSw1LjQxVjE2YTEsMSwwLDAsMCwyLDBWNS40MWwyLjI5LDIuM2ExLDEsMCwwLDAsMS40MiwwLDEsMSwwLDAsMCwwLTEuNDJsLTQtNGExLDEsMCwwLDAtMS40MiwwbC00LDRBMSwxLDAsMSwwLDguNzEsNy43MVoiLz48cGF0aCBkPSJNMTYuMjIsMTIuNDRhMSwxLDAsMCwwLTEuMi43NywxLDEsMCwwLDAsLjc2LDEuMTlDMTguNTUsMTUsMjAsMTYuMTcsMjAsMTdjMCwxLjIyLTMuMTIsMy04LDNzLTgtMS43OC04LTNjMC0uODMsMS40NS0yLDQuMjItMi42QTEsMSwwLDAsMCw5LDEzLjIxYTEsMSwwLDAsMC0xLjItLjc3QzQuMTYsMTMuMjUsMiwxNSwyLDE3YzAsMi44NSw0LjMsNSwxMCw1czEwLTIuMTUsMTAtNUMyMiwxNSwxOS44NCwxMy4yNSwxNi4yMiwxMi40NFoiLz48L3N2Zz4=") no-repeat}.mc-fileuploader__files.svelte-zs822y.svelte-zs822y{list-style:none;padding:0;margin:1rem 0 0 0}.mc-fileuploader__file.svelte-zs822y.svelte-zs822y{font-family:"Roboto", sans-serif;font-weight:400;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#e6e6e6;-webkit-box-sizing:content-box;box-sizing:content-box;color:#000000;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.mc-fileuploader__file.svelte-zs822y.svelte-zs822y:not(:last-child){margin-bottom:0.25rem}.mc-fileuploader__file-name.svelte-zs822y.svelte-zs822y{font-size:1rem;line-height:1.375;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:hidden;padding-left:0.75rem;padding-right:0.75rem;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 7.5rem)}.mc-fileuploader__file-icon.svelte-zs822y.svelte-zs822y{background-color:transparent;background-position:center right;background-repeat:no-repeat;background-size:1.5rem;display:block;height:1.5rem;margin-left:1rem;margin-right:1rem;width:1.5rem}.mc-fileuploader__file--is-valid.svelte-zs822y .mc-fileuploader__file-icon.svelte-zs822y{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjMDA5MTlmIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiA0YTggOCAwIDEgMS04IDggOCA4IDAgMCAxIDgtOG0wLTJhMTAgMTAgMCAxIDAgMTAgMTBBMTAgMTAgMCAwIDAgMTIgMnoiLz48cGF0aCBkPSJNMTAuNTkgMTYuMTJhMSAxIDAgMCAxLS42OC0uMjZsLTMuODQtMy41NWExIDEgMCAwIDEgMS4zNi0xLjQ3bDMuMTMgMi44OUwxNiA4LjE3YTEgMSAwIDAgMSAxLjQzIDEuNDFsLTYuMTMgNi4yNWExIDEgMCAwIDEtLjcxLjI5eiIvPjwvc3ZnPg==")}.mc-fileuploader__file--is-invalid.svelte-zs822y .mc-fileuploader__file-icon.svelte-zs822y{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjYzYxMTEyIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMSAwIDEwIDEwQTEwIDEwIDAgMCAwIDEyIDJ6bTAgMThhOCA4IDAgMSAxIDgtOCA4IDggMCAwIDEtOCA4eiIvPjxwYXRoIGQ9Ik0xMiA3YTEgMSAwIDAgMC0xIDF2NC4zOGExIDEgMCAwIDAgMiAwVjhhMSAxIDAgMCAwLTEtMXoiLz48Y2lyY2xlIGN4PSIxMiIgY3k9IjE2IiByPSIxIi8+PC9zdmc+")}.mc-fileuploader__delete.svelte-zs822y.svelte-zs822y{position:relative;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#cccccc;border:none;cursor:pointer;padding:0.5rem}.mc-fileuploader__delete.svelte-zs822y.svelte-zs822y::before{border-radius:2px;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;content:"";display:block;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-transition:-webkit-box-shadow 200ms ease;transition:-webkit-box-shadow 200ms ease;-o-transition:box-shadow 200ms ease;transition:box-shadow 200ms ease;transition:box-shadow 200ms ease, -webkit-box-shadow 200ms ease;top:-0.125rem;right:-0.125rem;bottom:-0.125rem;left:-0.125rem}.mc-fileuploader__delete.svelte-zs822y.svelte-zs822y::after{content:"";width:1.5rem;height:1.5rem;background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjMDAwMDAwIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xOC4wOCA4YTEgMSAwIDAgMC0xLjA4LjkyTDE2LjA4IDIwSDcuOTJMNyA4LjkyYTEgMSAwIDEgMC0yIC4xNmwxIDEyQTEgMSAwIDAgMCA3IDIyaDEwYTEgMSAwIDAgMCAxLS45MmwxLTEyQTEgMSAwIDAgMCAxOC4wOCA4eiIvPjxwYXRoIGQ9Ik0xOSA1aC0zLjc3bC0uNjUtMi4yN2ExIDEgMCAwIDAtMS0uNzNoLTMuMmExIDEgMCAwIDAtMSAuNzNMOC43NyA1SDVhMSAxIDAgMCAwIDAgMmgxNGExIDEgMCAwIDAgMC0yem0tOC42Mi0yaDMuMjRsLjU3IDJIOS44MXpNMTIuNSAxOHYtOGEuNS41IDAgMCAwLTEgMHY4YS41LjUgMCAwIDAgMSAwek0xNC4yNSAxOC41YS41LjUgMCAwIDAgLjUtLjQ3bC41LThhLjUuNSAwIDAgMC0uNDctLjUzLjQ5LjQ5IDAgMCAwLS41My40N2wtLjUgOGEuNS41IDAgMCAwIC40Ny41M3pNOS43NSAxOC41YS41LjUgMCAwIDAgLjQ3LS41M2wtLjUtOGEuNDkuNDkgMCAwIDAtLjUzLS40Ny41LjUgMCAwIDAtLjQ3LjUzbC41IDhhLjUuNSAwIDAgMCAuNTMuNDd6Ii8+PC9zdmc+") no-repeat;background-size:1.5rem;display:block}.mc-fileuploader__delete.svelte-zs822y.svelte-zs822y:focus{outline:none}.mc-fileuploader__delete.svelte-zs822y.svelte-zs822y:focus::before{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;-webkit-box-shadow:0 0 0 0.125rem #758992;box-shadow:0 0 0 0.125rem #758992}')}function y(e,s,l){const i=e.slice();return i[13]=s[l],i[15]=l,i}function D(e){let s,l,i,r,M,c,d,x,b,y,D,I=e[13].name+"";function A(){return e[8](e[13])}return{c(){s=t("li"),l=t("span"),i=w(I),r=m(),M=t("span"),M.textContent=" ",c=m(),d=t("button"),x=m(),o(l,"class","mc-fileuploader__file-name svelte-zs822y"),o(M,"class","mc-fileuploader__file-icon svelte-zs822y"),o(d,"type","button"),o(d,"class","mc-fileuploader__delete svelte-zs822y"),o(d,"aria-label",e[2]),d.disabled=e[1],o(s,"id",`file-${e[15]}`),o(s,"class",b=e[3](e[13])+" "+e[5].class+" svelte-zs822y")},m(e,t){a(e,s,t),g(s,l),g(l,i),g(s,r),g(s,M),g(s,c),g(s,d),g(s,x),y||(D=u(d,"click",A),y=!0)},p(l,t){e=l,1&t&&I!==(I=e[13].name+"")&&f(i,I),4&t&&o(d,"aria-label",e[2]),2&t&&(d.disabled=e[1]),33&t&&b!==(b=e[3](e[13])+" "+e[5].class+" svelte-zs822y")&&o(s,"class",b)},d(e){e&&n(s),y=!1,D()}}}function I(e){let s,l=e[0],i=[];for(let s=0;s<l.length;s+=1)i[s]=D(y(e,l,s));return{c(){s=t("ul");for(let e=0;e<i.length;e+=1)i[e].c();o(s,"class","mc-fileuploader__files svelte-zs822y")},m(e,l){a(e,s,l);for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(s,null)},p(e,[t]){if(63&t){let o;for(l=e[0],o=0;o<l.length;o+=1){const a=y(e,l,o);i[o]?i[o].p(a,t):(i[o]=D(a),i[o].c(),i[o].m(s,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=l.length}},i:r,o:r,d(e){e&&n(s),M(i,e)}}}function A(e,s,l){let{allowedExtensions:i}=s,{maxSize:t}=s,{disabled:o=!1}=s,{files:a}=s,{removelabel:r="Remove"}=s,n=new x;function M(e){n.dispatch("file-removed",e)}return e.$$set=e=>{l(5,s=c(c({},s),d(e))),"allowedExtensions"in e&&l(7,i=e.allowedExtensions),"maxSize"in e&&l(6,t=e.maxSize),"disabled"in e&&l(1,o=e.disabled),"files"in e&&l(0,a=e.files),"removelabel"in e&&l(2,r=e.removelabel)},e.$$.update=()=>{1&e.$$.dirty&&l(0,a=a||[]),64&e.$$.dirty&&l(6,t=t||void 0)},s=d(s),[a,o,r,function(e){let s=["mc-fileuploader__file"];return!function(e){const s=!i||function(e){if(i&&i.length>0){const s=e.slice(2+(e.lastIndexOf(".")-1>>>0));if(i&&!i.includes(String(s)))return!1}return!0}(e.name),l=function(e){const s=e/1024/1024;if(t&&s>t)return!1;return!0}(e.size);if(!s||!l)return!1;return!0}(e)?s.push("mc-fileuploader__file--is-invalid"):s.push("mc-fileuploader__file--is-valid"),s.join(" ")},M,s,t,i,e=>M(e)]}class z extends e{constructor(e){super(),s(this,e,A,I,l,{allowedExtensions:7,maxSize:6,disabled:1,files:0,removelabel:2},b)}}export{z as default};
1
+ import{P as e,i as s,s as l,Q as i,e as t,g as o,b as a,n as r,o as n,J as M,c,q as d,t as w,d as m,j as g,l as u,k as f}from"../../index-c33b3772.js";import{E as x}from"../../EventHandler-02058705.js";function b(e){i(e,"svelte-zs822y",'.mc-fileuploader.svelte-zs822y.svelte-zs822y{position:relative;display:block}.mc-fileuploader__input.svelte-zs822y.svelte-zs822y{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;visibility:visible;white-space:nowrap}.mc-fileuploader__label.svelte-zs822y.svelte-zs822y{font-family:"Roboto", sans-serif;font-weight:700;cursor:pointer;border-radius:4px;text-align:center;border:2px solid transparent;-webkit-transition:all ease 200ms;-o-transition:all ease 200ms;transition:all ease 200ms;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem;color:#007f8c;border-color:#007f8c;background-color:#ffffff;margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;-webkit-box-sizing:border-box;box-sizing:border-box}.mc-fileuploader__label.is-hover.svelte-zs822y.svelte-zs822y,.mc-fileuploader__label.svelte-zs822y.svelte-zs822y:hover{background-color:#d9f0f3;color:#006974}.mc-fileuploader__label.is-active.svelte-zs822y.svelte-zs822y,.mc-fileuploader__label.svelte-zs822y.svelte-zs822y:active{background-color:#91d5db;color:#004e57}.mc-fileuploader__label.is-active.svelte-zs822y.svelte-zs822y,.mc-fileuploader__label.svelte-zs822y.svelte-zs822y:active{background-color:#91d5db;color:#004e57}.mc-fileuploader__label.svelte-zs822y.svelte-zs822y:disabled,.mc-fileuploader__label.is-disabled.svelte-zs822y.svelte-zs822y{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-fileuploader__label.svelte-zs822y.svelte-zs822y::before{content:"";width:1.5rem;height:1.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjMDA3ZjhjIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjx0aXRsZT5NZWRpYV9VcGxvYWRfMjRweDwvdGl0bGU+PHBhdGggZD0iTTguNzEsNy43MSwxMSw1LjQxVjE2YTEsMSwwLDAsMCwyLDBWNS40MWwyLjI5LDIuM2ExLDEsMCwwLDAsMS40MiwwLDEsMSwwLDAsMCwwLTEuNDJsLTQtNGExLDEsMCwwLDAtMS40MiwwbC00LDRBMSwxLDAsMSwwLDguNzEsNy43MVoiLz48cGF0aCBkPSJNMTYuMjIsMTIuNDRhMSwxLDAsMCwwLTEuMi43NywxLDEsMCwwLDAsLjc2LDEuMTlDMTguNTUsMTUsMjAsMTYuMTcsMjAsMTdjMCwxLjIyLTMuMTIsMy04LDNzLTgtMS43OC04LTNjMC0uODMsMS40NS0yLDQuMjItMi42QTEsMSwwLDAsMCw5LDEzLjIxYTEsMSwwLDAsMC0xLjItLjc3QzQuMTYsMTMuMjUsMiwxNSwyLDE3YzAsMi44NSw0LjMsNSwxMCw1czEwLTIuMTUsMTAtNUMyMiwxNSwxOS44NCwxMy4yNSwxNi4yMiwxMi40NFoiLz48L3N2Zz4=") no-repeat;background-size:1.5rem;margin-right:0.5rem;margin-left:-0.5rem}.is-focus.svelte-zs822y+.mc-fileuploader__label.svelte-zs822y,.svelte-zs822y:focus+.mc-fileuploader__label.svelte-zs822y{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.is-hover.svelte-zs822y+.mc-fileuploader__label.svelte-zs822y,.svelte-zs822y:hover+.mc-fileuploader__label.svelte-zs822y{color:#006974;background-color:#d9f0f3}.is-disabled.svelte-zs822y+.mc-fileuploader__label.svelte-zs822y,.svelte-zs822y:disabled+.mc-fileuploader__label.svelte-zs822y{color:#666666;background-color:#cccccc;border-color:transparent;cursor:not-allowed}.is-disabled.svelte-zs822y+.mc-fileuploader__label.svelte-zs822y::before,.svelte-zs822y:disabled+.mc-fileuploader__label.svelte-zs822y::before{background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjNjY2NjY2IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjx0aXRsZT5NZWRpYV9VcGxvYWRfMjRweDwvdGl0bGU+PHBhdGggZD0iTTguNzEsNy43MSwxMSw1LjQxVjE2YTEsMSwwLDAsMCwyLDBWNS40MWwyLjI5LDIuM2ExLDEsMCwwLDAsMS40MiwwLDEsMSwwLDAsMCwwLTEuNDJsLTQtNGExLDEsMCwwLDAtMS40MiwwbC00LDRBMSwxLDAsMSwwLDguNzEsNy43MVoiLz48cGF0aCBkPSJNMTYuMjIsMTIuNDRhMSwxLDAsMCwwLTEuMi43NywxLDEsMCwwLDAsLjc2LDEuMTlDMTguNTUsMTUsMjAsMTYuMTcsMjAsMTdjMCwxLjIyLTMuMTIsMy04LDNzLTgtMS43OC04LTNjMC0uODMsMS40NS0yLDQuMjItMi42QTEsMSwwLDAsMCw5LDEzLjIxYTEsMSwwLDAsMC0xLjItLjc3QzQuMTYsMTMuMjUsMiwxNSwyLDE3YzAsMi44NSw0LjMsNSwxMCw1czEwLTIuMTUsMTAtNUMyMiwxNSwxOS44NCwxMy4yNSwxNi4yMiwxMi40NFoiLz48L3N2Zz4=") no-repeat}.mc-fileuploader__files.svelte-zs822y.svelte-zs822y{list-style:none;padding:0;margin:1rem 0 0 0}.mc-fileuploader__file.svelte-zs822y.svelte-zs822y{font-family:"Roboto", sans-serif;font-weight:400;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#e6e6e6;-webkit-box-sizing:content-box;box-sizing:content-box;color:#000000;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.mc-fileuploader__file.svelte-zs822y.svelte-zs822y:not(:last-child){margin-bottom:0.25rem}.mc-fileuploader__file-name.svelte-zs822y.svelte-zs822y{font-size:1rem;line-height:1.375;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:hidden;padding-left:0.75rem;padding-right:0.75rem;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 7.5rem)}.mc-fileuploader__file-icon.svelte-zs822y.svelte-zs822y{background-color:transparent;background-position:center right;background-repeat:no-repeat;background-size:1.5rem;display:block;height:1.5rem;margin-left:1rem;margin-right:1rem;width:1.5rem}.mc-fileuploader__file--is-valid.svelte-zs822y .mc-fileuploader__file-icon.svelte-zs822y{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjMDA5MTlmIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiA0YTggOCAwIDEgMS04IDggOCA4IDAgMCAxIDgtOG0wLTJhMTAgMTAgMCAxIDAgMTAgMTBBMTAgMTAgMCAwIDAgMTIgMnoiLz48cGF0aCBkPSJNMTAuNTkgMTYuMTJhMSAxIDAgMCAxLS42OC0uMjZsLTMuODQtMy41NWExIDEgMCAwIDEgMS4zNi0xLjQ3bDMuMTMgMi44OUwxNiA4LjE3YTEgMSAwIDAgMSAxLjQzIDEuNDFsLTYuMTMgNi4yNWExIDEgMCAwIDEtLjcxLjI5eiIvPjwvc3ZnPg==")}.mc-fileuploader__file--is-invalid.svelte-zs822y .mc-fileuploader__file-icon.svelte-zs822y{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjYzYxMTEyIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMSAwIDEwIDEwQTEwIDEwIDAgMCAwIDEyIDJ6bTAgMThhOCA4IDAgMSAxIDgtOCA4IDggMCAwIDEtOCA4eiIvPjxwYXRoIGQ9Ik0xMiA3YTEgMSAwIDAgMC0xIDF2NC4zOGExIDEgMCAwIDAgMiAwVjhhMSAxIDAgMCAwLTEtMXoiLz48Y2lyY2xlIGN4PSIxMiIgY3k9IjE2IiByPSIxIi8+PC9zdmc+")}.mc-fileuploader__delete.svelte-zs822y.svelte-zs822y{position:relative;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#cccccc;border:none;cursor:pointer;padding:0.5rem}.mc-fileuploader__delete.svelte-zs822y.svelte-zs822y::before{border-radius:2px;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;content:"";display:block;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-transition:-webkit-box-shadow 200ms ease;transition:-webkit-box-shadow 200ms ease;-o-transition:box-shadow 200ms ease;transition:box-shadow 200ms ease;transition:box-shadow 200ms ease, -webkit-box-shadow 200ms ease;top:-0.125rem;right:-0.125rem;bottom:-0.125rem;left:-0.125rem}.mc-fileuploader__delete.svelte-zs822y.svelte-zs822y::after{content:"";width:1.5rem;height:1.5rem;background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjMDAwMDAwIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xOC4wOCA4YTEgMSAwIDAgMC0xLjA4LjkyTDE2LjA4IDIwSDcuOTJMNyA4LjkyYTEgMSAwIDEgMC0yIC4xNmwxIDEyQTEgMSAwIDAgMCA3IDIyaDEwYTEgMSAwIDAgMCAxLS45MmwxLTEyQTEgMSAwIDAgMCAxOC4wOCA4eiIvPjxwYXRoIGQ9Ik0xOSA1aC0zLjc3bC0uNjUtMi4yN2ExIDEgMCAwIDAtMS0uNzNoLTMuMmExIDEgMCAwIDAtMSAuNzNMOC43NyA1SDVhMSAxIDAgMCAwIDAgMmgxNGExIDEgMCAwIDAgMC0yem0tOC42Mi0yaDMuMjRsLjU3IDJIOS44MXpNMTIuNSAxOHYtOGEuNS41IDAgMCAwLTEgMHY4YS41LjUgMCAwIDAgMSAwek0xNC4yNSAxOC41YS41LjUgMCAwIDAgLjUtLjQ3bC41LThhLjUuNSAwIDAgMC0uNDctLjUzLjQ5LjQ5IDAgMCAwLS41My40N2wtLjUgOGEuNS41IDAgMCAwIC40Ny41M3pNOS43NSAxOC41YS41LjUgMCAwIDAgLjQ3LS41M2wtLjUtOGEuNDkuNDkgMCAwIDAtLjUzLS40Ny41LjUgMCAwIDAtLjQ3LjUzbC41IDhhLjUuNSAwIDAgMCAuNTMuNDd6Ii8+PC9zdmc+") no-repeat;background-size:1.5rem;display:block}.mc-fileuploader__delete.svelte-zs822y.svelte-zs822y:focus{outline:none}.mc-fileuploader__delete.svelte-zs822y.svelte-zs822y:focus::before{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;-webkit-box-shadow:0 0 0 0.125rem #758992;box-shadow:0 0 0 0.125rem #758992}')}function y(e,s,l){const i=e.slice();return i[13]=s[l],i[15]=l,i}function D(e){let s,l,i,r,M,c,d,x,b,y,D,I=e[13].name+"";function A(){return e[8](e[13])}return{c(){s=t("li"),l=t("span"),i=w(I),r=m(),M=t("span"),M.textContent=" ",c=m(),d=t("button"),x=m(),o(l,"class","mc-fileuploader__file-name svelte-zs822y"),o(M,"class","mc-fileuploader__file-icon svelte-zs822y"),o(d,"type","button"),o(d,"class","mc-fileuploader__delete svelte-zs822y"),o(d,"aria-label",e[2]),d.disabled=e[1],o(s,"id",`file-${e[15]}`),o(s,"class",b=e[3](e[13])+" "+e[5].class+" svelte-zs822y")},m(e,t){a(e,s,t),g(s,l),g(l,i),g(s,r),g(s,M),g(s,c),g(s,d),g(s,x),y||(D=u(d,"click",A),y=!0)},p(l,t){e=l,1&t&&I!==(I=e[13].name+"")&&f(i,I),4&t&&o(d,"aria-label",e[2]),2&t&&(d.disabled=e[1]),33&t&&b!==(b=e[3](e[13])+" "+e[5].class+" svelte-zs822y")&&o(s,"class",b)},d(e){e&&n(s),y=!1,D()}}}function I(e){let s,l=e[0],i=[];for(let s=0;s<l.length;s+=1)i[s]=D(y(e,l,s));return{c(){s=t("ul");for(let e=0;e<i.length;e+=1)i[e].c();o(s,"id","file_uploaded"),o(s,"class","mc-fileuploader__files svelte-zs822y")},m(e,l){a(e,s,l);for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(s,null)},p(e,[t]){if(63&t){let o;for(l=e[0],o=0;o<l.length;o+=1){const a=y(e,l,o);i[o]?i[o].p(a,t):(i[o]=D(a),i[o].c(),i[o].m(s,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=l.length}},i:r,o:r,d(e){e&&n(s),M(i,e)}}}function A(e,s,l){let{allowedExtensions:i}=s,{maxSize:t}=s,{disabled:o=!1}=s,{files:a}=s,{removelabel:r="Remove"}=s,n=new x;function M(e){n.dispatch("file-removed",e)}return e.$$set=e=>{l(5,s=c(c({},s),d(e))),"allowedExtensions"in e&&l(7,i=e.allowedExtensions),"maxSize"in e&&l(6,t=e.maxSize),"disabled"in e&&l(1,o=e.disabled),"files"in e&&l(0,a=e.files),"removelabel"in e&&l(2,r=e.removelabel)},e.$$.update=()=>{1&e.$$.dirty&&l(0,a=a||[]),64&e.$$.dirty&&l(6,t=t||void 0)},s=d(s),[a,o,r,function(e){let s=["mc-fileuploader__file"];return!function(e){const s=!i||function(e){if(i&&i.length>0){const s=e.slice(2+(e.lastIndexOf(".")-1>>>0));if(i&&!i.includes(String(s)))return!1}return!0}(e.name),l=function(e){const s=e/1024/1024;if(t&&s>t)return!1;return!0}(e.size);if(!s||!l)return!1;return!0}(e)?s.push("mc-fileuploader__file--is-invalid"):s.push("mc-fileuploader__file--is-valid"),s.join(" ")},M,s,t,i,e=>M(e)]}class z extends e{constructor(e){super(),s(this,e,A,I,l,{allowedExtensions:7,maxSize:6,disabled:1,files:0,removelabel:2},b)}}export{z as default};
2
2
  //# sourceMappingURL=ResultFile.nested.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResultFile.nested.js","sources":["../../../../src/components/fileuploader/ResultFile.nested.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n // @ts-nocheck\n import { EventHandler } from '../../utilities/EventHandler';\n\n export let allowedExtensions: [];\n export let maxSize: number;\n export let disabled = false;\n export let files: FileList;\n export let removelabel = 'Remove';\n\n let eventHandler = new EventHandler();\n $: files = files ? (files as FileList) : [];\n $: maxSize = maxSize ? maxSize : undefined;\n\n function setClasses(file: File): string {\n let classes = ['mc-fileuploader__file'];\n\n if (checkFileStatus(file)) classes.push('mc-fileuploader__file--is-valid');\n else classes.push('mc-fileuploader__file--is-invalid');\n return classes.join(' ');\n }\n\n function checkFileExtension(fileName: string): boolean {\n if (allowedExtensions && allowedExtensions.length > 0) {\n const extension: string = fileName.slice(\n ((fileName.lastIndexOf('.') - 1) >>> 0) + 2,\n );\n if (allowedExtensions && !allowedExtensions.includes(String(extension))) {\n return false; // invalid\n }\n }\n\n return true; // valid\n }\n\n function checkFileSize(fileSize: number): boolean {\n const fileSizeMB = fileSize / 1024 / 1024; // in MB\n if (maxSize && fileSizeMB > maxSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n function checkFileStatus(file: File): boolean {\n const validExtension = allowedExtensions\n ? checkFileExtension(file.name)\n : true;\n const validSize = checkFileSize(file.size);\n\n if (!validExtension || !validSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n\n function deleteFile(file) {\n eventHandler.dispatch('file-removed', file);\n }\n</script>\n\n<ul class=\"mc-fileuploader__files\">\n {#each files as file, index}\n <li id={`file-${index}`} class=\"{setClasses(file)} {$$props.class}\">\n <span class=\"mc-fileuploader__file-name\">{file.name}</span>\n <span class=\"mc-fileuploader__file-icon\">&nbsp;</span>\n <button\n type=\"button\"\n class=\"mc-fileuploader__delete\"\n aria-label={removelabel}\n {disabled}\n on:click={() => deleteFile(file)}\n />\n </li>\n {/each}\n</ul>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n @import '@mozaic-ds/styles/components/c.file-uploader';\n</style>\n"],"names":["t0_value","ctx","name","attr","li","li_class_value","class","insert","target","anchor","append","span0","span1","button","dirty","set_data","t0","length","i","ul","allowedExtensions","$$props","maxSize","disabled","files","removelabel","eventHandler","EventHandler","deleteFile","file","dispatch","$$invalidate","undefined","classes","validExtension","fileName","extension","slice","lastIndexOf","includes","String","checkFileExtension","validSize","fileSize","fileSizeMB","checkFileSize","size","checkFileStatus","push","join"],"mappings":"62RAkEgDA,EAAAC,MAAKC,KAAI,oVAKrCD,EAAW,qCANXA,EAAK,OAAYE,EAAAC,EAAA,QAAAC,EAAAJ,EAAW,GAAAA,EAAQ,KAAA,IAAAA,KAAQK,MAAK,0BAAjEC,EAUIC,EAAAJ,EAAAK,GATFC,EAA0DN,EAAAO,iBAC1DD,EAAqDN,EAAAQ,UACrDF,EAMCN,EAAAS,iDARyC,EAAAC,GAAAd,KAAAA,EAAAC,MAAKC,KAAI,KAAAa,EAAAC,EAAAhB,yBAKrCC,EAAW,2BANM,GAAAa,GAAAT,KAAAA,EAAAJ,EAAW,GAAAA,EAAQ,KAAA,IAAAA,KAAQK,MAAK,iFAD5DL,EAAK,wBAAVgB,OAAIC,GAAA,yIADRX,EAcIC,EAAAW,EAAAV,mFAbKR,EAAK,WAAVgB,OAAIC,GAAA,EAAA,iHAAJD,+EA1DSG,GAAqBC,WACrBC,GAAeD,GACfE,SAAAA,GAAW,GAAKF,SAChBG,GAAeH,GACfI,YAAAA,EAAc,UAAQJ,EAE7BK,MAAmBC,EA8Cd,SAAAC,EAAWC,GAClBH,EAAaI,SAAS,eAAgBD,uQA9CrCE,EAAA,EAAAP,EAAQA,GAA2B,uBACnCF,EAAUA,QAAoBU,kBAExB,SAAWH,GACd,IAAAI,GAAW,gCA4BR,SAAgBJ,SACjBK,GAAiBd,GAtBhB,SAAmBe,GACtB,GAAAf,GAAqBA,EAAkBH,OAAS,EAAC,CAC7C,MAAAmB,EAAoBD,EAASE,MACS,GAAxCF,EAASG,YAAY,KAAO,IAAO,IAEnC,GAAAlB,IAAsBA,EAAkBmB,SAASC,OAAOJ,WACnD,SAIJ,EAaHK,CAAmBZ,EAAK3B,MAEtBwC,EAZC,SAAcC,GACf,MAAAC,EAAaD,EAAW,KAAO,QACjCrB,GAAWsB,EAAatB,SACnB,SAGF,EAMWuB,CAAchB,EAAKiB,MAEhC,IAAAZ,IAAmBQ,SACf,SAGF,EApCHK,CAAgBlB,GACfI,EAAQe,KAAK,qCADSf,EAAQe,KAAK,mCAEjCf,EAAQgB,KAAK,cAoDApB,GAAAD,EAAWC"}
1
+ {"version":3,"file":"ResultFile.nested.js","sources":["../../../../src/components/fileuploader/ResultFile.nested.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n // @ts-nocheck\n import { EventHandler } from '../../utilities/EventHandler';\n\n export let allowedExtensions: [];\n export let maxSize: number;\n export let disabled = false;\n export let files: FileList;\n export let removelabel = 'Remove';\n\n let eventHandler = new EventHandler();\n $: files = files ? (files as FileList) : [];\n $: maxSize = maxSize ? maxSize : undefined;\n\n function setClasses(file: File): string {\n let classes = ['mc-fileuploader__file'];\n\n if (checkFileStatus(file)) classes.push('mc-fileuploader__file--is-valid');\n else classes.push('mc-fileuploader__file--is-invalid');\n return classes.join(' ');\n }\n\n function checkFileExtension(fileName: string): boolean {\n if (allowedExtensions && allowedExtensions.length > 0) {\n const extension: string = fileName.slice(\n ((fileName.lastIndexOf('.') - 1) >>> 0) + 2,\n );\n if (allowedExtensions && !allowedExtensions.includes(String(extension))) {\n return false; // invalid\n }\n }\n\n return true; // valid\n }\n\n function checkFileSize(fileSize: number): boolean {\n const fileSizeMB = fileSize / 1024 / 1024; // in MB\n if (maxSize && fileSizeMB > maxSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n function checkFileStatus(file: File): boolean {\n const validExtension = allowedExtensions\n ? checkFileExtension(file.name)\n : true;\n const validSize = checkFileSize(file.size);\n\n if (!validExtension || !validSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n\n function deleteFile(file) {\n eventHandler.dispatch('file-removed', file);\n }\n</script>\n\n<ul id=\"file_uploaded\" class=\"mc-fileuploader__files\">\n {#each files as file, index}\n <li id={`file-${index}`} class=\"{setClasses(file)} {$$props.class}\">\n <span class=\"mc-fileuploader__file-name\">{file.name}</span>\n <span class=\"mc-fileuploader__file-icon\">&nbsp;</span>\n <button\n type=\"button\"\n class=\"mc-fileuploader__delete\"\n aria-label={removelabel}\n {disabled}\n on:click={() => deleteFile(file)}\n />\n </li>\n {/each}\n</ul>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n @import '@mozaic-ds/styles/components/c.file-uploader';\n</style>\n"],"names":["t0_value","ctx","name","attr","li","li_class_value","class","insert","target","anchor","append","span0","span1","button","dirty","set_data","t0","length","i","ul","allowedExtensions","$$props","maxSize","disabled","files","removelabel","eventHandler","EventHandler","deleteFile","file","dispatch","$$invalidate","undefined","classes","validExtension","fileName","extension","slice","lastIndexOf","includes","String","checkFileExtension","validSize","fileSize","fileSizeMB","checkFileSize","size","checkFileStatus","push","join"],"mappings":"62RAkEgDA,EAAAC,MAAKC,KAAI,oVAKrCD,EAAW,qCANXA,EAAK,OAAYE,EAAAC,EAAA,QAAAC,EAAAJ,EAAW,GAAAA,EAAQ,KAAA,IAAAA,KAAQK,MAAK,0BAAjEC,EAUIC,EAAAJ,EAAAK,GATFC,EAA0DN,EAAAO,iBAC1DD,EAAqDN,EAAAQ,UACrDF,EAMCN,EAAAS,iDARyC,EAAAC,GAAAd,KAAAA,EAAAC,MAAKC,KAAI,KAAAa,EAAAC,EAAAhB,yBAKrCC,EAAW,2BANM,GAAAa,GAAAT,KAAAA,EAAAJ,EAAW,GAAAA,EAAQ,KAAA,IAAAA,KAAQK,MAAK,iFAD5DL,EAAK,wBAAVgB,OAAIC,GAAA,mKADRX,EAcIC,EAAAW,EAAAV,mFAbKR,EAAK,WAAVgB,OAAIC,GAAA,EAAA,iHAAJD,+EA1DSG,GAAqBC,WACrBC,GAAeD,GACfE,SAAAA,GAAW,GAAKF,SAChBG,GAAeH,GACfI,YAAAA,EAAc,UAAQJ,EAE7BK,MAAmBC,EA8Cd,SAAAC,EAAWC,GAClBH,EAAaI,SAAS,eAAgBD,uQA9CrCE,EAAA,EAAAP,EAAQA,GAA2B,uBACnCF,EAAUA,QAAoBU,kBAExB,SAAWH,GACd,IAAAI,GAAW,gCA4BR,SAAgBJ,SACjBK,GAAiBd,GAtBhB,SAAmBe,GACtB,GAAAf,GAAqBA,EAAkBH,OAAS,EAAC,CAC7C,MAAAmB,EAAoBD,EAASE,MACS,GAAxCF,EAASG,YAAY,KAAO,IAAO,IAEnC,GAAAlB,IAAsBA,EAAkBmB,SAASC,OAAOJ,WACnD,SAIJ,EAaHK,CAAmBZ,EAAK3B,MAEtBwC,EAZC,SAAcC,GACf,MAAAC,EAAaD,EAAW,KAAO,QACjCrB,GAAWsB,EAAatB,SACnB,SAGF,EAMWuB,CAAchB,EAAKiB,MAEhC,IAAAZ,IAAmBQ,SACf,SAGF,EApCHK,CAAgBlB,GACfI,EAAQe,KAAK,qCADSf,EAAQe,KAAK,mCAEjCf,EAAQgB,KAAK,cAoDApB,GAAAD,EAAWC"}
@@ -1,2 +1,2 @@
1
- import{S as e,i as t,a as i,b as r,f as o,s as a,c as n,e as s,d as l,t as d,n as c,g as m,h as b,j as y,l as g,k as x,m as p,o as h,H as f,p as w,a1 as _,q as u,v}from"../../index-c33b3772.js";import{E as k}from"../../EventHandler-02058705.js";function $(e){let t,i=`<${D(e[5])} class="mc-layer__icon" />`;return{c(){t=s("span"),m(t,"class","mc-layer__icon")},m(e,o){r(e,t,o),t.innerHTML=i},p(e,r){32&r&&i!==(i=`<${D(e[5])} class="mc-layer__icon" />`)&&(t.innerHTML=i)},d(e){e&&h(t)}}}function M(e){let t;return{c(){t=s("footer"),t.innerHTML='<slot name="footer"></slot>',m(t,"class","mc-layer__footer")},m(e,i){r(e,t,i)},d(e){e&&h(t)}}}function A(e){let t,i,o,a,w,_,u,v,k,A,D,I,j,z,L,C,S,T,E,H,O,Z,N,P=e[5]&&$(e),Q=!e[8]&&M(),R=[{class:"mc-layer"},{tabindex:"-1"},{role:"dialog"},{"aria-labelledby":"layerTitle"},{"aria-modal":"true"},{"aria-hidden":T=!e[0]},e[6]],W={};for(let e=0;e<R.length;e+=1)W=n(W,R[e]);return{c(){t=s("div"),i=s("div"),o=s("div"),a=s("div"),P&&P.c(),w=l(),_=s("h2"),u=d(e[1]),v=l(),k=s("button"),A=s("span"),D=d(e[4]),I=l(),j=s("main"),z=s("article"),z.innerHTML='<slot name="content"></slot>',C=l(),Q&&Q.c(),E=l(),H=s("div"),this.c=c,m(_,"class","mc-layer__title"),m(_,"id","modallayerTitleTitle"),m(A,"class","mc-layer__close-text"),m(k,"class","mc-layer__close"),m(k,"type","button"),m(a,"class","mc-layer__header"),m(z,"class","mc-layer__content"),m(j,"class",L="mc-layer__body "+(e[3]?"mc-layer__body--overflowing-scroll-edge":"")),m(o,"class",S="mc-layer__dialog "+(e[0]?" is-open":"")+" "+(e[2]?" mc-layer__dialog--extend":"")),m(o,"role","document"),b(i,W),m(H,"class",O="mc-layer-overlay "+(e[0]?" is-visible":"")),m(H,"tabindex","-1"),m(H,"role","dialog")},m(n,s){r(n,t,s),y(t,i),y(i,o),y(o,a),P&&P.m(a,null),y(a,w),y(a,_),y(_,u),y(a,v),y(a,k),y(k,A),y(A,D),y(o,I),y(o,j),y(j,z),y(o,C),Q&&Q.m(o,null),y(t,E),y(t,H),e[13](t),Z||(N=[g(k,"click",e[11]),g(H,"click",e[12])],Z=!0)},p(e,[t]){e[5]?P?P.p(e,t):(P=$(e),P.c(),P.m(a,w)):P&&(P.d(1),P=null),2&t&&x(u,e[1]),16&t&&x(D,e[4]),8&t&&L!==(L="mc-layer__body "+(e[3]?"mc-layer__body--overflowing-scroll-edge":""))&&m(j,"class",L),e[8]?Q&&(Q.d(1),Q=null):Q||(Q=M(),Q.c(),Q.m(o,null)),5&t&&S!==(S="mc-layer__dialog "+(e[0]?" is-open":"")+" "+(e[2]?" mc-layer__dialog--extend":""))&&m(o,"class",S),b(i,W=p(R,[{class:"mc-layer"},{tabindex:"-1"},{role:"dialog"},{"aria-labelledby":"layerTitle"},{"aria-modal":"true"},1&t&&T!==(T=!e[0])&&{"aria-hidden":T},64&t&&e[6]])),1&t&&O!==(O="mc-layer-overlay "+(e[0]?" is-visible":""))&&m(H,"class",O)},i:c,o:c,d(i){i&&h(t),P&&P.d(),Q&&Q.d(),e[13](null),Z=!1,f(N)}}}function D(e){return`${e} size="1.5rem"`}function I(e,t,i){let r,o;const a=["title","isopen","extended","scrollbaredge","closebuttontext","iconname","hidefooter"];let s,l=w(t,a),{title:d}=t,{isopen:c}=t,{extended:m}=t,{scrollbaredge:b}=t,{closebuttontext:y="Close"}=t,{iconname:g}=t,{hidefooter:x}=t,p=new k;function h(){i(0,c=!1)}_((()=>{const e=s.querySelector(".mc-layer__body"),t=s.querySelector(".mc-layer__content"),i=b?"mc-layer__body--overflowing-scroll-edge":"mc-layer__body--overflowing";if(e&&t){const r=e.clientHeight;t.scrollHeight>r?e.classList.add(i):e.classList.remove(i)}}));return e.$$set=e=>{t=n(n({},t),u(e)),i(15,l=w(t,a)),"title"in e&&i(1,d=e.title),"isopen"in e&&i(0,c=e.isopen),"extended"in e&&i(2,m=e.extended),"scrollbaredge"in e&&i(3,b=e.scrollbaredge),"closebuttontext"in e&&i(4,y=e.closebuttontext),"iconname"in e&&i(5,g=e.iconname),"hidefooter"in e&&i(10,x=e.hidefooter)},e.$$.update=()=>{1024&e.$$.dirty&&i(8,r=null!=x&&x),1&e.$$.dirty&&(c?p.dispatch("layer-opened",{}):p.dispatch("layer-closed",{})),i(6,o=Object.assign({},l)),64&e.$$.dirty&&delete o.class},[c,d,m,b,y,g,o,s,r,h,x,()=>h(),()=>h(),function(e){v[e?"unshift":"push"]((()=>{s=e,i(7,s)}))}]}class j extends e{constructor(e){super();const n=document.createElement("style");n.textContent='.mc-layer{font-family:"Roboto", sans-serif;font-weight:400;-webkit-box-sizing:border-box;box-sizing:border-box;bottom:0;left:0;outline:0;pointer-events:none;position:fixed;right:0;top:0;z-index:1999999999;display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden}.mc-layer *{-webkit-box-sizing:inherit;box-sizing:inherit}.mc-layer--ltr{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.mc-layer--ltr .mc-layer__dialog{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0)}.mc-layer:not(.mc-layer--ltr){-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.mc-layer:not(.mc-layer--ltr) .mc-layer__dialog{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0)}.mc-layer__dialog{background:#ffffff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;max-width:calc(100% - 2rem);-webkit-transition:visibility 0s linear 0.4s, -webkit-transform 0.4s;transition:visibility 0s linear 0.4s, -webkit-transform 0.4s;-o-transition:visibility 0s linear 0.4s, transform 0.4s;transition:visibility 0s linear 0.4s, transform 0.4s;transition:visibility 0s linear 0.4s, transform 0.4s, -webkit-transform 0.4s;visibility:hidden;width:100%}@media screen and (min-width: 680px){.mc-layer__dialog{max-width:25rem}}@media screen and (min-width: 769px){.mc-layer__dialog{max-width:28.6875rem}}@media screen and (min-width: 1024px){.mc-layer__dialog{max-width:28rem}}@media screen and (min-width: 680px){.mc-layer__dialog--extend{max-width:31.75rem}}@media screen and (min-width: 769px){.mc-layer__dialog--extend{max-width:36.3125rem}}@media screen and (min-width: 1024px){.mc-layer__dialog--extend{max-width:43rem}}.mc-layer__header,.mc-layer__footer{padding-left:1rem;padding-right:1rem}@media screen and (min-width: 1024px){.mc-layer__header,.mc-layer__footer{padding-left:2rem;padding-right:2rem}}.mc-layer__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-bottom:0.5rem;padding-top:1rem;min-height:3.75rem;position:relative}.mc-layer__header::after{background:#b3b3b3;content:"";display:block;margin:0 auto;height:1px;width:100%;bottom:0;left:0;position:absolute}@media screen and (min-width: 1024px){.mc-layer__header{padding-bottom:0.75rem;padding-top:1.25rem;min-height:4.25rem}}.mc-layer__icon{fill:#666666;height:1.5rem;margin-right:0.75rem;width:1.5rem}.mc-layer__title{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#666666;margin-bottom:0;margin-top:0}.mc-layer__close{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;position:relative;-ms-flex-item-align:start;align-self:flex-start;background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMnJlbSIgd2lkdGg9IjJyZW0iIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0iIzgwODA4MCI+PHBhdGggZD0iTTE3LjQxIDE2bDguOC04Ljc5YTEgMSAwIDEwLTEuNDItMS40MkwxNiAxNC41OWwtOC43OS04LjhhMSAxIDAgMDAtMS40MiAxLjQybDguOCA4Ljc5LTguOCA4Ljc5YTEgMSAwIDAwMCAxLjQyIDEgMSAwIDAwMS40MiAwbDguNzktOC44IDguNzkgOC44YTEgMSAwIDAwMS40MiAwIDEgMSAwIDAwMC0xLjQyeiIvPjwvc3ZnPg==") no-repeat;background-size:contain;cursor:pointer;height:2rem;margin-left:auto;width:2rem}.mc-layer__close::after{border-radius:2px;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;content:"";display:block;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-transition:-webkit-box-shadow 200ms ease;transition:-webkit-box-shadow 200ms ease;-o-transition:box-shadow 200ms ease;transition:box-shadow 200ms ease;transition:box-shadow 200ms ease, -webkit-box-shadow 200ms ease}.mc-layer__close-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;visibility:visible;white-space:nowrap}.mc-layer__close:focus::after{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.mc-layer__body{-webkit-box-flex:1;-ms-flex:1 1;flex:1 1;overflow:hidden;padding-left:0.5rem;padding-right:0.5rem}@media screen and (min-width: 1024px){.mc-layer__body{padding-left:1rem;padding-right:1rem}}.mc-layer__body--overflowing-scroll-edge+.mc-layer__footer{-webkit-box-shadow:0px 4px 20px 0px rgba(25, 25, 25, 0.2);box-shadow:0px 4px 20px 0px rgba(25, 25, 25, 0.2);position:relative}.mc-layer__body--overflowing-scroll-edge{padding-left:0;padding-right:0}.mc-layer__body--overflowing-scroll-edge .mc-layer__content{padding-left:1rem;padding-right:1.125rem}@media screen and (min-width: 1024px){.mc-layer__body--overflowing-scroll-edge .mc-layer__content{padding-left:2rem;padding-right:2rem}}.mc-layer__content{max-height:100%;overflow-y:auto;overflow-x:hidden;padding:1.5rem 0.5rem 3rem;scrollbar-color:#666666 #e6e6e6;scrollbar-width:thin}@media screen and (min-width: 1024px){.mc-layer__content{padding-left:1rem;padding-right:1rem}}.mc-layer__content::-webkit-scrollbar{background-color:#e6e6e6;width:0.25rem}.mc-layer__content::-webkit-scrollbar-thumb{background:#666666}.mc-layer__footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-top:1rem;padding-bottom:1rem}@media screen and (min-width: 1024px){.mc-layer__footer{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-top:1.5rem;padding-bottom:1.5rem}}.mc-layer__footer>:first-child:not(:only-child){margin-bottom:0.75rem}@media screen and (min-width: 1024px){.mc-layer__footer>:first-child:not(:only-child){margin-bottom:0;margin-right:1rem}}.mc-layer-open{overflow:hidden}.mc-layer .mc-layer__dialog.is-open{pointer-events:all;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);-webkit-transition:visibility 0s linear 0s, -webkit-transform 0.4s;transition:visibility 0s linear 0s, -webkit-transform 0.4s;-o-transition:visibility 0s linear 0s, transform 0.4s;transition:visibility 0s linear 0s, transform 0.4s;transition:visibility 0s linear 0s, transform 0.4s, -webkit-transform 0.4s;visibility:visible}.mc-layer-overlay{background-color:rgba(25, 25, 25, 0.7);-webkit-filter:blur(1px);filter:blur(1px);inset:0;opacity:0;position:fixed;pointer-events:none;-webkit-transition:opacity 0.4s ease, visibility 0ms 0.4s;-o-transition:opacity 0.4s ease, visibility 0ms 0.4s;transition:opacity 0.4s ease, visibility 0ms 0.4s;z-index:1999999998}.mc-layer-overlay.is-visible{opacity:1;pointer-events:all;-webkit-transition:opacity 0.4s ease, visibility 0ms;-o-transition:opacity 0.4s ease, visibility 0ms;transition:opacity 0.4s ease, visibility 0ms;visibility:visible}',this.shadowRoot.appendChild(n),t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},I,A,a,{title:1,isopen:0,extended:2,scrollbaredge:3,closebuttontext:4,iconname:5,hidefooter:10},null),e&&(e.target&&r(e.target,this,e.anchor),e.props&&(this.$set(e.props),o()))}static get observedAttributes(){return["title","isopen","extended","scrollbaredge","closebuttontext","iconname","hidefooter"]}get title(){return this.$$.ctx[1]}set title(e){this.$$set({title:e}),o()}get isopen(){return this.$$.ctx[0]}set isopen(e){this.$$set({isopen:e}),o()}get extended(){return this.$$.ctx[2]}set extended(e){this.$$set({extended:e}),o()}get scrollbaredge(){return this.$$.ctx[3]}set scrollbaredge(e){this.$$set({scrollbaredge:e}),o()}get closebuttontext(){return this.$$.ctx[4]}set closebuttontext(e){this.$$set({closebuttontext:e}),o()}get iconname(){return this.$$.ctx[5]}set iconname(e){this.$$set({iconname:e}),o()}get hidefooter(){return this.$$.ctx[10]}set hidefooter(e){this.$$set({hidefooter:e}),o()}}export{j as default};
1
+ import{S as e,i as t,a as i,b as a,f as r,s as o,c as n,e as l,d as s,t as d,n as c,g as m,h as b,j as y,l as g,k as x,m as p,o as h,H as f,p as w,a1 as _,q as u,v}from"../../index-c33b3772.js";import{E as k}from"../../EventHandler-02058705.js";function $(e){let t,i=`<${D(e[5])} class="mc-layer__icon" />`;return{c(){t=l("span"),m(t,"class","mc-layer__icon")},m(e,r){a(e,t,r),t.innerHTML=i},p(e,a){32&a&&i!==(i=`<${D(e[5])} class="mc-layer__icon" />`)&&(t.innerHTML=i)},d(e){e&&h(t)}}}function M(e){let t;return{c(){t=l("footer"),t.innerHTML='<slot name="footer"></slot>',m(t,"class","mc-layer__footer")},m(e,i){a(e,t,i)},d(e){e&&h(t)}}}function A(e){let t,i,r,o,w,_,u,v,k,A,D,I,j,L,z,C,S,T,E,H,O,Z,N,P=e[5]&&$(e),Q=!e[9]&&M(),R=[{class:"mc-layer"},{tabindex:"-1"},{role:"dialog"},{"aria-labelledby":e[6]},{"aria-modal":"true"},{"aria-hidden":T=!e[0]},e[7]],W={};for(let e=0;e<R.length;e+=1)W=n(W,R[e]);return{c(){t=l("div"),i=l("div"),r=l("div"),o=l("div"),P&&P.c(),w=s(),_=l("h2"),u=d(e[1]),v=s(),k=l("button"),A=l("span"),D=d(e[4]),I=s(),j=l("main"),L=l("article"),L.innerHTML='<slot name="content"></slot>',C=s(),Q&&Q.c(),E=s(),H=l("div"),this.c=c,m(_,"class","mc-layer__title"),m(_,"id","modallayerTitleTitle"),m(A,"class","mc-layer__close-text"),m(k,"class","mc-layer__close"),m(k,"type","button"),m(o,"class","mc-layer__header"),m(L,"class","mc-layer__content"),m(j,"class",z="mc-layer__body "+(e[3]?"mc-layer__body--overflowing-scroll-edge":"")),m(r,"class",S="mc-layer__dialog "+(e[0]?" is-open":"")+" "+(e[2]?" mc-layer__dialog--extend":"")),m(r,"role","document"),b(i,W),m(H,"class",O="mc-layer-overlay "+(e[0]?" is-visible":"")),m(H,"tabindex","-1"),m(H,"role","dialog")},m(n,l){a(n,t,l),y(t,i),y(i,r),y(r,o),P&&P.m(o,null),y(o,w),y(o,_),y(_,u),y(o,v),y(o,k),y(k,A),y(A,D),y(r,I),y(r,j),y(j,L),y(r,C),Q&&Q.m(r,null),y(t,E),y(t,H),e[14](t),Z||(N=[g(k,"click",e[12]),g(H,"click",e[13])],Z=!0)},p(e,[t]){e[5]?P?P.p(e,t):(P=$(e),P.c(),P.m(o,w)):P&&(P.d(1),P=null),2&t&&x(u,e[1]),16&t&&x(D,e[4]),8&t&&z!==(z="mc-layer__body "+(e[3]?"mc-layer__body--overflowing-scroll-edge":""))&&m(j,"class",z),e[9]?Q&&(Q.d(1),Q=null):Q||(Q=M(),Q.c(),Q.m(r,null)),5&t&&S!==(S="mc-layer__dialog "+(e[0]?" is-open":"")+" "+(e[2]?" mc-layer__dialog--extend":""))&&m(r,"class",S),b(i,W=p(R,[{class:"mc-layer"},{tabindex:"-1"},{role:"dialog"},64&t&&{"aria-labelledby":e[6]},{"aria-modal":"true"},1&t&&T!==(T=!e[0])&&{"aria-hidden":T},128&t&&e[7]])),1&t&&O!==(O="mc-layer-overlay "+(e[0]?" is-visible":""))&&m(H,"class",O)},i:c,o:c,d(i){i&&h(t),P&&P.d(),Q&&Q.d(),e[14](null),Z=!1,f(N)}}}function D(e){return`${e} size="1.5rem"`}function I(e,t,i){let a,r;const o=["title","isopen","extended","scrollbaredge","closebuttontext","iconname","hidefooter","arialabelledby"];let l,s=w(t,o),{title:d}=t,{isopen:c}=t,{extended:m}=t,{scrollbaredge:b}=t,{closebuttontext:y="Close"}=t,{iconname:g}=t,{hidefooter:x}=t,{arialabelledby:p="LayerTitle"}=t,h=new k;function f(){i(0,c=!1)}_((()=>{const e=l.querySelector(".mc-layer__body"),t=l.querySelector(".mc-layer__content"),i=b?"mc-layer__body--overflowing-scroll-edge":"mc-layer__body--overflowing";if(e&&t){const a=e.clientHeight;t.scrollHeight>a?e.classList.add(i):e.classList.remove(i)}}));return e.$$set=e=>{t=n(n({},t),u(e)),i(16,s=w(t,o)),"title"in e&&i(1,d=e.title),"isopen"in e&&i(0,c=e.isopen),"extended"in e&&i(2,m=e.extended),"scrollbaredge"in e&&i(3,b=e.scrollbaredge),"closebuttontext"in e&&i(4,y=e.closebuttontext),"iconname"in e&&i(5,g=e.iconname),"hidefooter"in e&&i(11,x=e.hidefooter),"arialabelledby"in e&&i(6,p=e.arialabelledby)},e.$$.update=()=>{2048&e.$$.dirty&&i(9,a=null!=x&&x),1&e.$$.dirty&&(c?h.dispatch("layer-opened",{}):h.dispatch("layer-closed",{})),i(7,r=Object.assign({},s)),128&e.$$.dirty&&delete r.class},[c,d,m,b,y,g,p,r,l,a,f,x,()=>f(),()=>f(),function(e){v[e?"unshift":"push"]((()=>{l=e,i(8,l)}))}]}class j extends e{constructor(e){super();const n=document.createElement("style");n.textContent='.mc-layer{font-family:"Roboto", sans-serif;font-weight:400;-webkit-box-sizing:border-box;box-sizing:border-box;bottom:0;left:0;outline:0;pointer-events:none;position:fixed;right:0;top:0;z-index:1999999999;display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden}.mc-layer *{-webkit-box-sizing:inherit;box-sizing:inherit}.mc-layer--ltr{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.mc-layer--ltr .mc-layer__dialog{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0)}.mc-layer:not(.mc-layer--ltr){-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.mc-layer:not(.mc-layer--ltr) .mc-layer__dialog{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0)}.mc-layer__dialog{background:#ffffff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;max-width:calc(100% - 2rem);-webkit-transition:visibility 0s linear 0.4s, -webkit-transform 0.4s;transition:visibility 0s linear 0.4s, -webkit-transform 0.4s;-o-transition:visibility 0s linear 0.4s, transform 0.4s;transition:visibility 0s linear 0.4s, transform 0.4s;transition:visibility 0s linear 0.4s, transform 0.4s, -webkit-transform 0.4s;visibility:hidden;width:100%}@media screen and (min-width: 680px){.mc-layer__dialog{max-width:25rem}}@media screen and (min-width: 769px){.mc-layer__dialog{max-width:28.6875rem}}@media screen and (min-width: 1024px){.mc-layer__dialog{max-width:28rem}}@media screen and (min-width: 680px){.mc-layer__dialog--extend{max-width:31.75rem}}@media screen and (min-width: 769px){.mc-layer__dialog--extend{max-width:36.3125rem}}@media screen and (min-width: 1024px){.mc-layer__dialog--extend{max-width:43rem}}.mc-layer__header,.mc-layer__footer{padding-left:1rem;padding-right:1rem}@media screen and (min-width: 1024px){.mc-layer__header,.mc-layer__footer{padding-left:2rem;padding-right:2rem}}.mc-layer__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-bottom:0.5rem;padding-top:1rem;min-height:3.75rem;position:relative}.mc-layer__header::after{background:#b3b3b3;content:"";display:block;margin:0 auto;height:1px;width:100%;bottom:0;left:0;position:absolute}@media screen and (min-width: 1024px){.mc-layer__header{padding-bottom:0.75rem;padding-top:1.25rem;min-height:4.25rem}}.mc-layer__icon{fill:#666666;height:1.5rem;margin-right:0.75rem;width:1.5rem}.mc-layer__title{font-size:0.875rem;line-height:1.2857142857;font-weight:400;color:#666666;margin-bottom:0;margin-top:0}.mc-layer__close{margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;border:none;cursor:pointer;padding:0;position:relative;-ms-flex-item-align:start;align-self:flex-start;background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMnJlbSIgd2lkdGg9IjJyZW0iIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0iIzgwODA4MCI+PHBhdGggZD0iTTE3LjQxIDE2bDguOC04Ljc5YTEgMSAwIDEwLTEuNDItMS40MkwxNiAxNC41OWwtOC43OS04LjhhMSAxIDAgMDAtMS40MiAxLjQybDguOCA4Ljc5LTguOCA4Ljc5YTEgMSAwIDAwMCAxLjQyIDEgMSAwIDAwMS40MiAwbDguNzktOC44IDguNzkgOC44YTEgMSAwIDAwMS40MiAwIDEgMSAwIDAwMC0xLjQyeiIvPjwvc3ZnPg==") no-repeat;background-size:contain;cursor:pointer;height:2rem;margin-left:auto;width:2rem}.mc-layer__close::after{border-radius:2px;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;content:"";display:block;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-transition:-webkit-box-shadow 200ms ease;transition:-webkit-box-shadow 200ms ease;-o-transition:box-shadow 200ms ease;transition:box-shadow 200ms ease;transition:box-shadow 200ms ease, -webkit-box-shadow 200ms ease}.mc-layer__close-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;visibility:visible;white-space:nowrap}.mc-layer__close:focus::after{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.mc-layer__body{-webkit-box-flex:1;-ms-flex:1 1;flex:1 1;overflow:hidden;padding-left:0.5rem;padding-right:0.5rem}@media screen and (min-width: 1024px){.mc-layer__body{padding-left:1rem;padding-right:1rem}}.mc-layer__body--overflowing-scroll-edge+.mc-layer__footer{-webkit-box-shadow:0px 4px 20px 0px rgba(25, 25, 25, 0.2);box-shadow:0px 4px 20px 0px rgba(25, 25, 25, 0.2);position:relative}.mc-layer__body--overflowing-scroll-edge{padding-left:0;padding-right:0}.mc-layer__body--overflowing-scroll-edge .mc-layer__content{padding-left:1rem;padding-right:1.125rem}@media screen and (min-width: 1024px){.mc-layer__body--overflowing-scroll-edge .mc-layer__content{padding-left:2rem;padding-right:2rem}}.mc-layer__content{max-height:100%;overflow-y:auto;overflow-x:hidden;padding:1.5rem 0.5rem 3rem;scrollbar-color:#666666 #e6e6e6;scrollbar-width:thin}@media screen and (min-width: 1024px){.mc-layer__content{padding-left:1rem;padding-right:1rem}}.mc-layer__content::-webkit-scrollbar{background-color:#e6e6e6;width:0.25rem}.mc-layer__content::-webkit-scrollbar-thumb{background:#666666}.mc-layer__footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-top:1rem;padding-bottom:1rem}@media screen and (min-width: 1024px){.mc-layer__footer{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-top:1.5rem;padding-bottom:1.5rem}}.mc-layer__footer>:first-child:not(:only-child){margin-bottom:0.75rem}@media screen and (min-width: 1024px){.mc-layer__footer>:first-child:not(:only-child){margin-bottom:0;margin-right:1rem}}.mc-layer-open{overflow:hidden}.mc-layer .mc-layer__dialog.is-open{pointer-events:all;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);-webkit-transition:visibility 0s linear 0s, -webkit-transform 0.4s;transition:visibility 0s linear 0s, -webkit-transform 0.4s;-o-transition:visibility 0s linear 0s, transform 0.4s;transition:visibility 0s linear 0s, transform 0.4s;transition:visibility 0s linear 0s, transform 0.4s, -webkit-transform 0.4s;visibility:visible}.mc-layer-overlay{background-color:rgba(25, 25, 25, 0.7);-webkit-filter:blur(1px);filter:blur(1px);inset:0;opacity:0;position:fixed;pointer-events:none;-webkit-transition:opacity 0.4s ease, visibility 0ms 0.4s;-o-transition:opacity 0.4s ease, visibility 0ms 0.4s;transition:opacity 0.4s ease, visibility 0ms 0.4s;z-index:1999999998}.mc-layer-overlay.is-visible{opacity:1;pointer-events:all;-webkit-transition:opacity 0.4s ease, visibility 0ms;-o-transition:opacity 0.4s ease, visibility 0ms;transition:opacity 0.4s ease, visibility 0ms;visibility:visible}',this.shadowRoot.appendChild(n),t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},I,A,o,{title:1,isopen:0,extended:2,scrollbaredge:3,closebuttontext:4,iconname:5,hidefooter:11,arialabelledby:6},null),e&&(e.target&&a(e.target,this,e.anchor),e.props&&(this.$set(e.props),r()))}static get observedAttributes(){return["title","isopen","extended","scrollbaredge","closebuttontext","iconname","hidefooter","arialabelledby"]}get title(){return this.$$.ctx[1]}set title(e){this.$$set({title:e}),r()}get isopen(){return this.$$.ctx[0]}set isopen(e){this.$$set({isopen:e}),r()}get extended(){return this.$$.ctx[2]}set extended(e){this.$$set({extended:e}),r()}get scrollbaredge(){return this.$$.ctx[3]}set scrollbaredge(e){this.$$set({scrollbaredge:e}),r()}get closebuttontext(){return this.$$.ctx[4]}set closebuttontext(e){this.$$set({closebuttontext:e}),r()}get iconname(){return this.$$.ctx[5]}set iconname(e){this.$$set({iconname:e}),r()}get hidefooter(){return this.$$.ctx[11]}set hidefooter(e){this.$$set({hidefooter:e}),r()}get arialabelledby(){return this.$$.ctx[6]}set arialabelledby(e){this.$$set({arialabelledby:e}),r()}}export{j as default};
2
2
  //# sourceMappingURL=Layer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Layer.js","sources":["../../../../src/components/layer/Layer.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { onMount } from 'svelte/internal';\n import { EventHandler } from '../../utilities/EventHandler';\n export let title: string;\n export let isopen: boolean;\n export let extended: boolean;\n export let scrollbaredge: boolean;\n export let closebuttontext = 'Close';\n export let iconname: string | undefined = undefined;\n export let hidefooter: boolean;\n\n $: hideFooter = hidefooter ?? false;\n $: isopen\n ? eventHandler.dispatch('layer-opened', {})\n : eventHandler.dispatch('layer-closed', {});\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n let root: HTMLElement;\n let eventHandler = new EventHandler();\n onMount(() => {\n const body = root.querySelector('.mc-layer__body');\n const content = root.querySelector('.mc-layer__content');\n const overflowingClass = !scrollbaredge\n ? 'mc-layer__body--overflowing'\n : 'mc-layer__body--overflowing-scroll-edge';\n if (body && content) {\n const bodyHeight = body.clientHeight;\n const contentHeight = content.scrollHeight;\n\n if (contentHeight > bodyHeight) {\n body.classList.add(overflowingClass);\n } else {\n body.classList.remove(overflowingClass);\n }\n }\n });\n\n function onClose(): void {\n isopen = false;\n }\n\n function generateIconName(iconname: string): string {\n return `${iconname} size=\"1.5rem\"`;\n }\n</script>\n\n<div bind:this={root}>\n <div\n class=\"mc-layer\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby=\"layerTitle\"\n aria-modal=\"true\"\n aria-hidden={!isopen}\n {...attributes}\n >\n <div\n class=\"mc-layer__dialog {isopen ? ' is-open' : ''} {extended\n ? ' mc-layer__dialog--extend'\n : ''}\"\n role=\"document\"\n >\n <div class=\"mc-layer__header\">\n {#if iconname}\n <span class=\"mc-layer__icon\">\n {@html `<${generateIconName(iconname)} class=\"mc-layer__icon\" />`}\n </span>\n {/if}\n <h2 class=\"mc-layer__title\" id=\"modallayerTitleTitle\">{title}</h2>\n <button\n class=\"mc-layer__close\"\n type=\"button\"\n on:click={() => onClose()}\n >\n <span class=\"mc-layer__close-text\">{closebuttontext}</span>\n </button>\n </div>\n <main\n class=\"mc-layer__body {scrollbaredge\n ? 'mc-layer__body--overflowing-scroll-edge'\n : ''}\"\n >\n <article class=\"mc-layer__content\">\n <slot name=\"content\" />\n </article>\n </main>\n {#if !hideFooter}\n <footer class=\"mc-layer__footer\">\n <slot name=\"footer\" />\n </footer>\n {/if}\n </div>\n </div>\n <div\n class=\"mc-layer-overlay {isopen ? ' is-visible' : ''}\"\n tabindex=\"-1\"\n role=\"dialog\"\n on:click={() => onClose()}\n />\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.layer';\n</style>\n"],"names":["raw_value","generateIconName","ctx","insert","target","span","anchor","dirty","innerHTML","footer","create_if_block_1","create_if_block","div4","append","div2","div1","div0","h2","button","main","article","div3","div2_aria_hidden_value","iconname","root","title","$$props","isopen","extended","scrollbaredge","closebuttontext","hidefooter","eventHandler","EventHandler","onClose","$$invalidate","onMount","body","querySelector","content","overflowingClass","bodyHeight","clientHeight","scrollHeight","classList","add","remove","hideFooter","dispatch","attributes","Object","assign","$$restProps","class","$$value"],"mappings":"yQAmEuBA,EAAA,IAAAC,EAAiBC,EAAQ,6FADtCC,EAEMC,EAAAC,EAAAC,yBADO,GAAAC,GAAAP,KAAAA,EAAA,IAAAC,EAAiBC,EAAQ,mCAAAG,EAAAG,UAAAR,kJAsBxCG,EAEQC,EAAAK,EAAAH,qFA1BHJ,EAAQ,IAAAQ,EAAAR,MAuBTA,EAAU,IAAAS,mIAjCJT,EAAM,IAChBA,EAAU,qIAc6CA,EAAK,wCAMtBA,EAAe,mXAI9BA,EAAA,GACnB,0CACA,wCAvBmBA,EAAM,GAAG,WAAa,SAAKA,EAAA,GAChD,4BACA,sEAmCmBA,EAAM,GAAG,cAAgB,uDAhDtDC,EAqDKC,EAAAQ,EAAAN,GApDHO,EA6CKD,EAAAE,GApCHD,EAmCKC,EAAAC,GA7BHF,EAcKE,EAAAC,yBARHH,EAAiEG,EAAAC,iBACjEJ,EAMQG,EAAAE,GADNL,EAA0DK,EAAAb,iBAG9DQ,EAQME,EAAAI,GAHJN,EAESM,EAAAC,gCASfP,EAKCD,EAAAS,0EAnCUnB,EAAQ,kEAK0CA,EAAK,cAMtBA,EAAe,mCAI9BA,EAAA,GACnB,0CACA,qBAMAA,EAAU,oFA7BSA,EAAM,GAAG,WAAa,SAAKA,EAAA,GAChD,4BACA,uJANQA,EAAM,KAAA,CAAA,cAAAoB,SAChBpB,EAAU,uCAwCWA,EAAM,GAAG,cAAgB,qFArD3C,SAAAD,EAAiBsB,YACdA,gJAzBRC,kBAdOC,GAAaC,UACbC,GAAeD,YACfE,GAAiBF,iBACjBG,GAAsBH,GACtBI,gBAAAA,EAAkB,SAAOJ,GACzBH,SAAAA,GAAwCG,cACxCK,GAAmBL,EAS1BM,MAAmBC,WAmBdC,IACPC,EAAA,EAAAR,GAAS,GAnBXS,GAAO,KACC,MAAAC,EAAOb,EAAKc,cAAc,mBAC1BC,EAAUf,EAAKc,cAAc,sBAC7BE,EAAoBX,EAEtB,0CADA,8BAEA,GAAAQ,GAAQE,EAAO,OACXE,EAAaJ,EAAKK,aACFH,EAAQI,aAEVF,EAClBJ,EAAKO,UAAUC,IAAIL,GAEnBH,EAAKO,UAAUE,OAAON,+VArB3BL,EAAA,EAAEY,EAAahB,SAAAA,kBACbJ,EACCK,EAAagB,SAAS,eAAc,IACpChB,EAAagB,SAAS,eAAc,CAAA,QACrCC,EAALC,OAAAC,UAAuBC,0BACXH,EAAWI,kCAwDGnB,QAyBNA,4CAnDJV,EAAI8B"}
1
+ {"version":3,"file":"Layer.js","sources":["../../../../src/components/layer/Layer.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { onMount } from 'svelte/internal';\n import { EventHandler } from '../../utilities/EventHandler';\n export let title: string;\n export let isopen: boolean;\n export let extended: boolean;\n export let scrollbaredge: boolean;\n export let closebuttontext = 'Close';\n export let iconname: string | undefined = undefined;\n export let hidefooter: boolean;\n export let arialabelledby = 'LayerTitle';\n\n $: hideFooter = hidefooter ?? false;\n $: isopen\n ? eventHandler.dispatch('layer-opened', {})\n : eventHandler.dispatch('layer-closed', {});\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n let root: HTMLElement;\n let eventHandler = new EventHandler();\n onMount(() => {\n const body = root.querySelector('.mc-layer__body');\n const content = root.querySelector('.mc-layer__content');\n const overflowingClass = !scrollbaredge\n ? 'mc-layer__body--overflowing'\n : 'mc-layer__body--overflowing-scroll-edge';\n if (body && content) {\n const bodyHeight = body.clientHeight;\n const contentHeight = content.scrollHeight;\n\n if (contentHeight > bodyHeight) {\n body.classList.add(overflowingClass);\n } else {\n body.classList.remove(overflowingClass);\n }\n }\n });\n\n function onClose(): void {\n isopen = false;\n }\n\n function generateIconName(iconname: string): string {\n return `${iconname} size=\"1.5rem\"`;\n }\n</script>\n\n<div bind:this={root}>\n <div\n class=\"mc-layer\"\n tabindex=\"-1\"\n role=\"dialog\"\n aria-labelledby={arialabelledby}\n aria-modal=\"true\"\n aria-hidden={!isopen}\n {...attributes}\n >\n <div\n class=\"mc-layer__dialog {isopen ? ' is-open' : ''} {extended\n ? ' mc-layer__dialog--extend'\n : ''}\"\n role=\"document\"\n >\n <div class=\"mc-layer__header\">\n {#if iconname}\n <span class=\"mc-layer__icon\">\n {@html `<${generateIconName(iconname)} class=\"mc-layer__icon\" />`}\n </span>\n {/if}\n <h2 class=\"mc-layer__title\" id=\"modallayerTitleTitle\">{title}</h2>\n <button\n class=\"mc-layer__close\"\n type=\"button\"\n on:click={() => onClose()}\n >\n <span class=\"mc-layer__close-text\">{closebuttontext}</span>\n </button>\n </div>\n <main\n class=\"mc-layer__body {scrollbaredge\n ? 'mc-layer__body--overflowing-scroll-edge'\n : ''}\"\n >\n <article class=\"mc-layer__content\">\n <slot name=\"content\" />\n </article>\n </main>\n {#if !hideFooter}\n <footer class=\"mc-layer__footer\">\n <slot name=\"footer\" />\n </footer>\n {/if}\n </div>\n </div>\n <div\n class=\"mc-layer-overlay {isopen ? ' is-visible' : ''}\"\n tabindex=\"-1\"\n role=\"dialog\"\n on:click={() => onClose()}\n />\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.layer';\n</style>\n"],"names":["raw_value","generateIconName","ctx","insert","target","span","anchor","dirty","innerHTML","footer","create_if_block_1","create_if_block","div4","append","div2","div1","div0","h2","button","main","article","div3","div2_aria_hidden_value","iconname","root","title","$$props","isopen","extended","scrollbaredge","closebuttontext","hidefooter","arialabelledby","eventHandler","EventHandler","onClose","$$invalidate","onMount","body","querySelector","content","overflowingClass","bodyHeight","clientHeight","scrollHeight","classList","add","remove","hideFooter","dispatch","attributes","Object","assign","$$restProps","class","$$value"],"mappings":"yQAoEuBA,EAAA,IAAAC,EAAiBC,EAAQ,6FADtCC,EAEMC,EAAAC,EAAAC,yBADO,GAAAC,GAAAP,KAAAA,EAAA,IAAAC,EAAiBC,EAAQ,mCAAAG,EAAAG,UAAAR,kJAsBxCG,EAEQC,EAAAK,EAAAH,qFA1BHJ,EAAQ,IAAAQ,EAAAR,MAuBTA,EAAU,IAAAS,6EAnCDT,EAAc,4CAEjBA,EAAM,IAChBA,EAAU,qIAc6CA,EAAK,wCAMtBA,EAAe,mXAI9BA,EAAA,GACnB,0CACA,wCAvBmBA,EAAM,GAAG,WAAa,SAAKA,EAAA,GAChD,4BACA,sEAmCmBA,EAAM,GAAG,cAAgB,uDAhDtDC,EAqDKC,EAAAQ,EAAAN,GApDHO,EA6CKD,EAAAE,GApCHD,EAmCKC,EAAAC,GA7BHF,EAcKE,EAAAC,yBARHH,EAAiEG,EAAAC,iBACjEJ,EAMQG,EAAAE,GADNL,EAA0DK,EAAAb,iBAG9DQ,EAQME,EAAAI,GAHJN,EAESM,EAAAC,gCASfP,EAKCD,EAAAS,0EAnCUnB,EAAQ,kEAK0CA,EAAK,cAMtBA,EAAe,mCAI9BA,EAAA,GACnB,0CACA,qBAMAA,EAAU,oFA7BSA,EAAM,GAAG,WAAa,SAAKA,EAAA,GAChD,4BACA,4GARWA,EAAc,uCAEjBA,EAAM,KAAA,CAAA,cAAAoB,UAChBpB,EAAU,uCAwCWA,EAAM,GAAG,cAAgB,qFArD3C,SAAAD,EAAiBsB,YACdA,iKAzBRC,kBAfOC,GAAaC,UACbC,GAAeD,YACfE,GAAiBF,iBACjBG,GAAsBH,GACtBI,gBAAAA,EAAkB,SAAOJ,GACzBH,SAAAA,GAAwCG,cACxCK,GAAmBL,GACnBM,eAAAA,EAAiB,cAAYN,EASpCO,MAAmBC,WAmBdC,IACPC,EAAA,EAAAT,GAAS,GAnBXU,GAAO,KACC,MAAAC,EAAOd,EAAKe,cAAc,mBAC1BC,EAAUhB,EAAKe,cAAc,sBAC7BE,EAAoBZ,EAEtB,0CADA,8BAEA,GAAAS,GAAQE,EAAO,OACXE,EAAaJ,EAAKK,aACFH,EAAQI,aAEVF,EAClBJ,EAAKO,UAAUC,IAAIL,GAEnBH,EAAKO,UAAUE,OAAON,6YArB3BL,EAAA,EAAEY,EAAajB,SAAAA,kBACbJ,EACCM,EAAagB,SAAS,eAAc,IACpChB,EAAagB,SAAS,eAAc,CAAA,QACrCC,EAALC,OAAAC,UAAuBC,2BACXH,EAAWI,oCAwDGnB,QAyBNA,4CAnDJX,EAAI+B"}
@@ -10,6 +10,7 @@
10
10
  export let closebuttontext = 'Close';
11
11
  export let iconname: string | undefined = undefined;
12
12
  export let hidefooter: boolean;
13
+ export let arialabelledby = 'LayerTitle';
13
14
 
14
15
  $: hideFooter = hidefooter ?? false;
15
16
  $: isopen
@@ -51,7 +52,7 @@
51
52
  class="mc-layer"
52
53
  tabindex="-1"
53
54
  role="dialog"
54
- aria-labelledby="layerTitle"
55
+ aria-labelledby={arialabelledby}
55
56
  aria-modal="true"
56
57
  aria-hidden={!isopen}
57
58
  {...attributes}
@@ -1,2 +1,2 @@
1
- import{S as e,i,a as t,b as n,f as s,s as o,c as r,e as l,d as c,t as a,n as m,h,j as d,B as f,l as k,X as b,m as p,o as g,H as u,p as x,r as $,q as v,g as w,O as y}from"../../index-c33b3772.js";import{c as z}from"../../EventForward-8492ff62.js";function _(e){let i,t,s=`<${L(e[6])} />`;return{c(){i=l("span"),w(i,"class",t=M(e[7]))},m(e,t){n(e,i,t),i.innerHTML=s},p(e,n){64&n&&s!==(s=`<${L(e[6])} />`)&&(i.innerHTML=s),128&n&&t!==(t=M(e[7]))&&w(i,"class",t)},d(e){e&&g(i)}}}function j(e){let i,t,s=`<${L(e[6])} />`;return{c(){i=l("span"),w(i,"class",t=M(e[7]))},m(e,t){n(e,i,t),i.innerHTML=s},p(e,n){64&n&&s!==(s=`<${L(e[6])} />`)&&(i.innerHTML=s),128&n&&t!==(t=M(e[7]))&&w(i,"class",t)},d(e){e&&g(i)}}}function H(e){let i,t,s,o,x,$,v,w=e[6]&&"left"===e[7]&&_(e),y=e[6]&&"right"===e[7]&&j(e),z=[{href:e[1]},{target:e[2]},{class:x=T(e[3],e[5])+" "+(e[4]?"is-disabled":"")+" "+e[9]},e[8]],H={};for(let e=0;e<z.length;e+=1)H=r(H,z[e]);return{c(){i=l("a"),w&&w.c(),t=c(),s=a(e[0]),o=c(),y&&y.c(),this.c=m,h(i,H)},m(r,l){n(r,i,l),w&&w.m(i,null),d(i,t),d(i,s),d(i,o),y&&y.m(i,null),$||(v=[f(e[10].call(null,i)),k(i,"click",e[11])],$=!0)},p(e,[n]){e[6]&&"left"===e[7]?w?w.p(e,n):(w=_(e),w.c(),w.m(i,t)):w&&(w.d(1),w=null),1&n&&b(s,e[0],H.contenteditable),e[6]&&"right"===e[7]?y?y.p(e,n):(y=j(e),y.c(),y.m(i,null)):y&&(y.d(1),y=null),h(i,H=p(z,[2&n&&{href:e[1]},4&n&&{target:e[2]},568&n&&x!==(x=T(e[3],e[5])+" "+(e[4]?"is-disabled":"")+" "+e[9])&&{class:x},256&n&&e[8]]))},i:m,o:m,d(e){e&&g(i),w&&w.d(),y&&y.d(),$=!1,u(v)}}}function L(e){return`${e} size="1rem"`}function M(e){const i=["mc-link__icon"];return"left"===e&&i.push("mc-link__icon--left"),"right"===e&&i.push("mc-link__icon--right"),i.join(" ")}function T(e,i){const t=["mc-link"];return e&&t.push(`mc-link--${e}`),i&&t.push(`mc-link--${i}`),t.join(" ")}function C(e,i,t){let n,s;const o=["label","href","target","theme","disabled","size","iconname","iconposition"];let l=x(i,o),{label:c}=i,{href:a}=i,{target:m}=i,{theme:h}=i,{disabled:d=!1}=i,{size:f="m"}=i,{iconname:k}=i,{iconposition:b}=i;const p=z($());return e.$$set=e=>{t(13,i=r(r({},i),v(e))),t(12,l=x(i,o)),"label"in e&&t(0,c=e.label),"href"in e&&t(1,a=e.href),"target"in e&&t(2,m=e.target),"theme"in e&&t(3,h=e.theme),"disabled"in e&&t(4,d=e.disabled),"size"in e&&t(5,f=e.size),"iconname"in e&&t(6,k=e.iconname),"iconposition"in e&&t(7,b=e.iconposition)},e.$$.update=()=>{t(9,n=i.class),t(8,s=Object.assign({},l)),256&e.$$.dirty&&delete s.class},i=v(i),[c,a,m,h,d,f,k,b,s,n,p,function(i){y.call(this,e,i)}]}class E extends e{constructor(e){super();const r=document.createElement("style");r.textContent='.mc-link{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:inherit;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;line-height:inherit;text-decoration:underline;-webkit-transition:color ease 200ms;-o-transition:color ease 200ms;transition:color ease 200ms;gap:0.25rem;color:#000000;position:relative;font-size:1rem;line-height:1.375}.mc-link:focus{outline:none}.mc-link:focus::after{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.mc-link.is-visited,.mc-link:visited{color:#333333}.mc-link.is-hover,.mc-link:hover{color:#666666}.mc-link.is-active,.mc-link:active{color:#333333}.mc-link.is-disabled{color:#e6e6e6;cursor:not-allowed}.mc-link--s{font-size:0.875rem;line-height:1.2857142857}.mc-link--m{font-size:1rem;line-height:1.375}.mc-link::after{border-radius:2px;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;content:"";display:block;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-transition:-webkit-box-shadow 200ms ease;transition:-webkit-box-shadow 200ms ease;-o-transition:box-shadow 200ms ease;transition:box-shadow 200ms ease;transition:box-shadow 200ms ease, -webkit-box-shadow 200ms ease}.mc-link__icon{display:block;height:1rem;fill:currentColor;-ms-flex-negative:0;flex-shrink:0;width:1rem}.mc-link--light{color:#ffffff}.mc-link--light.is-visited,.mc-link--light:visited{color:#cccccc}.mc-link--light.is-hover,.mc-link--light:hover{color:#999999}.mc-link--light.is-active,.mc-link--light:active{color:#cccccc}.mc-link--light.is-disabled{color:#e6e6e6;cursor:not-allowed}.mc-link--primary{color:#007f8c}.mc-link--primary.is-visited,.mc-link--primary:visited{color:#006974}.mc-link--primary.is-hover,.mc-link--primary:hover{color:#004e57}.mc-link--primary.is-active,.mc-link--primary:active{color:#006974}.mc-link--primary.is-disabled{color:#e6e6e6;cursor:not-allowed}.mc-link--primary-02{color:#494f60}.mc-link--primary-02.is-visited,.mc-link--primary-02:visited{color:#343b4c}.mc-link--primary-02.is-hover,.mc-link--primary-02:hover{color:#171b26}.mc-link--primary-02.is-active,.mc-link--primary-02:active{color:#343b4c}.mc-link--primary-02.is-disabled{color:#e6e6e6;cursor:not-allowed}.mc-link--danger{color:#c61112}.mc-link--danger.is-visited,.mc-link--danger:visited{color:#8c0003}.mc-link--danger.is-hover,.mc-link--danger:hover{color:#530000}.mc-link--danger.is-active,.mc-link--danger:active{color:#8c0003}.mc-link--danger.is-disabled{color:#e6e6e6;cursor:not-allowed}@media screen and (min-width: 680px){.mc-link--s\\@from-m{font-size:0.875rem;line-height:1.2857142857}.mc-link--m\\@from-m{font-size:1rem;line-height:1.375}}@media screen and (min-width: 1024px){.mc-link--s\\@from-l{font-size:0.875rem;line-height:1.2857142857}.mc-link--m\\@from-l{font-size:1rem;line-height:1.375}}@media screen and (min-width: 1280px){.mc-link--s\\@from-xl{font-size:0.875rem;line-height:1.2857142857}.mc-link--m\\@from-xl{font-size:1rem;line-height:1.375}}@media screen and (min-width: 1920px){.mc-link--s\\@from-xxl{font-size:0.875rem;line-height:1.2857142857}.mc-link--m\\@from-xxl{font-size:1rem;line-height:1.375}}',this.shadowRoot.appendChild(r),i(this,{target:this.shadowRoot,props:t(this.attributes),customElement:!0},C,H,o,{label:0,href:1,target:2,theme:3,disabled:4,size:5,iconname:6,iconposition:7},null),e&&(e.target&&n(e.target,this,e.anchor),e.props&&(this.$set(e.props),s()))}static get observedAttributes(){return["label","href","target","theme","disabled","size","iconname","iconposition"]}get label(){return this.$$.ctx[0]}set label(e){this.$$set({label:e}),s()}get href(){return this.$$.ctx[1]}set href(e){this.$$set({href:e}),s()}get target(){return this.$$.ctx[2]}set target(e){this.$$set({target:e}),s()}get theme(){return this.$$.ctx[3]}set theme(e){this.$$set({theme:e}),s()}get disabled(){return this.$$.ctx[4]}set disabled(e){this.$$set({disabled:e}),s()}get size(){return this.$$.ctx[5]}set size(e){this.$$set({size:e}),s()}get iconname(){return this.$$.ctx[6]}set iconname(e){this.$$set({iconname:e}),s()}get iconposition(){return this.$$.ctx[7]}set iconposition(e){this.$$set({iconposition:e}),s()}}export{E as default};
1
+ import{S as e,i,a as t,b as n,f as s,s as o,c as r,e as l,d as c,t as a,n as m,h,j as d,B as f,l as k,I as b,X as p,m as g,o as u,H as x,p as $,r as v,q as w,g as y,O as z}from"../../index-c33b3772.js";import{c as _}from"../../EventForward-8492ff62.js";function j(e){let i,t,s=`<${M(e[6])} />`;return{c(){i=l("span"),y(i,"class",t=T(e[7]))},m(e,t){n(e,i,t),i.innerHTML=s},p(e,n){64&n&&s!==(s=`<${M(e[6])} />`)&&(i.innerHTML=s),128&n&&t!==(t=T(e[7]))&&y(i,"class",t)},d(e){e&&u(i)}}}function H(e){let i,t,s=`<${M(e[6])} />`;return{c(){i=l("span"),y(i,"class",t=T(e[7]))},m(e,t){n(e,i,t),i.innerHTML=s},p(e,n){64&n&&s!==(s=`<${M(e[6])} />`)&&(i.innerHTML=s),128&n&&t!==(t=T(e[7]))&&y(i,"class",t)},d(e){e&&u(i)}}}function L(e){let i,t,s,o,$,v,w,y=e[6]&&"left"===e[7]&&j(e),z=e[6]&&"right"===e[7]&&H(e),_=[{href:e[1]},{target:e[2]},{class:$=C(e[3],e[5])+" "+(e[4]?"is-disabled":"")+" "+e[9]},e[8]],L={};for(let e=0;e<_.length;e+=1)L=r(L,_[e]);return{c(){i=l("a"),y&&y.c(),t=c(),s=a(e[0]),o=c(),z&&z.c(),this.c=m,h(i,L)},m(r,l){n(r,i,l),y&&y.m(i,null),d(i,t),d(i,s),d(i,o),z&&z.m(i,null),v||(w=[f(e[10].call(null,i)),k(i,"click",b(e[11]))],v=!0)},p(e,[n]){e[6]&&"left"===e[7]?y?y.p(e,n):(y=j(e),y.c(),y.m(i,t)):y&&(y.d(1),y=null),1&n&&p(s,e[0],L.contenteditable),e[6]&&"right"===e[7]?z?z.p(e,n):(z=H(e),z.c(),z.m(i,null)):z&&(z.d(1),z=null),h(i,L=g(_,[2&n&&{href:e[1]},4&n&&{target:e[2]},568&n&&$!==($=C(e[3],e[5])+" "+(e[4]?"is-disabled":"")+" "+e[9])&&{class:$},256&n&&e[8]]))},i:m,o:m,d(e){e&&u(i),y&&y.d(),z&&z.d(),v=!1,x(w)}}}function M(e){return`${e} size="1rem"`}function T(e){const i=["mc-link__icon"];return"left"===e&&i.push("mc-link__icon--left"),"right"===e&&i.push("mc-link__icon--right"),i.join(" ")}function C(e,i){const t=["mc-link"];return e&&t.push(`mc-link--${e}`),i&&t.push(`mc-link--${i}`),t.join(" ")}function E(e,i,t){let n,s;const o=["label","href","target","theme","disabled","size","iconname","iconposition"];let l=$(i,o),{label:c}=i,{href:a}=i,{target:m}=i,{theme:h}=i,{disabled:d=!1}=i,{size:f="m"}=i,{iconname:k}=i,{iconposition:b}=i;const p=_(v());return e.$$set=e=>{t(13,i=r(r({},i),w(e))),t(12,l=$(i,o)),"label"in e&&t(0,c=e.label),"href"in e&&t(1,a=e.href),"target"in e&&t(2,m=e.target),"theme"in e&&t(3,h=e.theme),"disabled"in e&&t(4,d=e.disabled),"size"in e&&t(5,f=e.size),"iconname"in e&&t(6,k=e.iconname),"iconposition"in e&&t(7,b=e.iconposition)},e.$$.update=()=>{t(9,n=i.class),t(8,s=Object.assign({},l)),256&e.$$.dirty&&delete s.class},i=w(i),[c,a,m,h,d,f,k,b,s,n,p,function(i){z.call(this,e,i)}]}class O extends e{constructor(e){super();const r=document.createElement("style");r.textContent='.mc-link{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:inherit;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;line-height:inherit;text-decoration:underline;-webkit-transition:color ease 200ms;-o-transition:color ease 200ms;transition:color ease 200ms;gap:0.25rem;color:#000000;position:relative;font-size:1rem;line-height:1.375}.mc-link:focus{outline:none}.mc-link:focus::after{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #758992}.mc-link.is-visited,.mc-link:visited{color:#333333}.mc-link.is-hover,.mc-link:hover{color:#666666}.mc-link.is-active,.mc-link:active{color:#333333}.mc-link.is-disabled{color:#e6e6e6;cursor:not-allowed}.mc-link--s{font-size:0.875rem;line-height:1.2857142857}.mc-link--m{font-size:1rem;line-height:1.375}.mc-link::after{border-radius:2px;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;content:"";display:block;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-transition:-webkit-box-shadow 200ms ease;transition:-webkit-box-shadow 200ms ease;-o-transition:box-shadow 200ms ease;transition:box-shadow 200ms ease;transition:box-shadow 200ms ease, -webkit-box-shadow 200ms ease}.mc-link__icon{display:block;height:1rem;fill:currentColor;-ms-flex-negative:0;flex-shrink:0;width:1rem}.mc-link--light{color:#ffffff}.mc-link--light.is-visited,.mc-link--light:visited{color:#cccccc}.mc-link--light.is-hover,.mc-link--light:hover{color:#999999}.mc-link--light.is-active,.mc-link--light:active{color:#cccccc}.mc-link--light.is-disabled{color:#e6e6e6;cursor:not-allowed}.mc-link--primary{color:#007f8c}.mc-link--primary.is-visited,.mc-link--primary:visited{color:#006974}.mc-link--primary.is-hover,.mc-link--primary:hover{color:#004e57}.mc-link--primary.is-active,.mc-link--primary:active{color:#006974}.mc-link--primary.is-disabled{color:#e6e6e6;cursor:not-allowed}.mc-link--primary-02{color:#494f60}.mc-link--primary-02.is-visited,.mc-link--primary-02:visited{color:#343b4c}.mc-link--primary-02.is-hover,.mc-link--primary-02:hover{color:#171b26}.mc-link--primary-02.is-active,.mc-link--primary-02:active{color:#343b4c}.mc-link--primary-02.is-disabled{color:#e6e6e6;cursor:not-allowed}.mc-link--danger{color:#c61112}.mc-link--danger.is-visited,.mc-link--danger:visited{color:#8c0003}.mc-link--danger.is-hover,.mc-link--danger:hover{color:#530000}.mc-link--danger.is-active,.mc-link--danger:active{color:#8c0003}.mc-link--danger.is-disabled{color:#e6e6e6;cursor:not-allowed}@media screen and (min-width: 680px){.mc-link--s\\@from-m{font-size:0.875rem;line-height:1.2857142857}.mc-link--m\\@from-m{font-size:1rem;line-height:1.375}}@media screen and (min-width: 1024px){.mc-link--s\\@from-l{font-size:0.875rem;line-height:1.2857142857}.mc-link--m\\@from-l{font-size:1rem;line-height:1.375}}@media screen and (min-width: 1280px){.mc-link--s\\@from-xl{font-size:0.875rem;line-height:1.2857142857}.mc-link--m\\@from-xl{font-size:1rem;line-height:1.375}}@media screen and (min-width: 1920px){.mc-link--s\\@from-xxl{font-size:0.875rem;line-height:1.2857142857}.mc-link--m\\@from-xxl{font-size:1rem;line-height:1.375}}',this.shadowRoot.appendChild(r),i(this,{target:this.shadowRoot,props:t(this.attributes),customElement:!0},E,L,o,{label:0,href:1,target:2,theme:3,disabled:4,size:5,iconname:6,iconposition:7},null),e&&(e.target&&n(e.target,this,e.anchor),e.props&&(this.$set(e.props),s()))}static get observedAttributes(){return["label","href","target","theme","disabled","size","iconname","iconposition"]}get label(){return this.$$.ctx[0]}set label(e){this.$$set({label:e}),s()}get href(){return this.$$.ctx[1]}set href(e){this.$$set({href:e}),s()}get target(){return this.$$.ctx[2]}set target(e){this.$$set({target:e}),s()}get theme(){return this.$$.ctx[3]}set theme(e){this.$$set({theme:e}),s()}get disabled(){return this.$$.ctx[4]}set disabled(e){this.$$set({disabled:e}),s()}get size(){return this.$$.ctx[5]}set size(e){this.$$set({size:e}),s()}get iconname(){return this.$$.ctx[6]}set iconname(e){this.$$set({iconname:e}),s()}get iconposition(){return this.$$.ctx[7]}set iconposition(e){this.$$set({iconposition:e}),s()}}export{O as default};
2
2
  //# sourceMappingURL=Link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sources":["../../../../src/components/link/Link.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { get_current_component } from 'svelte/internal';\n import type { LinkIconPosition, LinkSize, LinkTheme } from './link.types';\n import { createEventForwarder } from '../../utilities/EventForward';\n export let label: string;\n export let href: string;\n export let target: string;\n export let theme: LinkTheme = undefined;\n export let disabled = false;\n export let size: LinkSize = 'm';\n export let iconname: string | undefined = undefined;\n export let iconposition: LinkIconPosition | undefined = undefined;\n\n const forwardEvents = createEventForwarder(get_current_component());\n\n $: userClass = $$props.class;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n function generateIconName(iconName: string): string {\n return `${iconName} size=\"1rem\"`;\n }\n\n function generateIconClass(iconposition: string): string {\n const classes = ['mc-link__icon'];\n\n if (iconposition === 'left') {\n classes.push('mc-link__icon--left');\n }\n\n if (iconposition === 'right') {\n classes.push('mc-link__icon--right');\n }\n return classes.join(' ');\n }\n\n function setClasses(theme: LinkTheme, size: LinkSize): string {\n const classes = ['mc-link'];\n\n if (theme) {\n classes.push(`mc-link--${theme}`);\n }\n if (size) {\n classes.push(`mc-link--${size}`);\n }\n return classes.join(' ');\n }\n</script>\n\n<a\n use:forwardEvents\n on:click\n {href}\n {target}\n class=\"{setClasses(theme, size)} {disabled ? 'is-disabled' : ''} {userClass}\"\n {...attributes}\n>\n {#if iconname && iconposition === 'left'}\n <span class={generateIconClass(iconposition)}>\n {@html `<${generateIconName(iconname)} />`}\n </span>\n {/if}\n\n {label}\n\n {#if iconname && iconposition === 'right'}\n <span class={generateIconClass(iconposition)}>\n {@html `<${generateIconName(iconname)} />`}\n </span>\n {/if}\n</a>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.links';\n</style>\n"],"names":["raw_value","generateIconName","ctx","attr","span","span_class_value","generateIconClass","insert","target","anchor","dirty","innerHTML","create_if_block_1","create_if_block","setClasses","a","a_data","class","a_class_value","iconName","iconposition","classes","push","join","theme","size","label","$$props","href","disabled","iconname","forwardEvents","createEventForwarder","get_current_component","$$invalidate","userClass","attributes","Object","assign","$$restProps"],"mappings":"4QA6DiBA,EAAA,IAAAC,EAAiBC,EAAQ,gCADzBC,EAAAC,EAAA,QAAAC,EAAAC,EAAkBJ,EAAY,aAA3CK,EAEMC,EAAAJ,EAAAK,yBADO,GAAAC,GAAAV,KAAAA,EAAA,IAAAC,EAAiBC,EAAQ,YAAAE,EAAAO,UAAAX,GADzB,IAAAU,GAAAL,KAAAA,EAAAC,EAAkBJ,EAAY,2DAS9BF,EAAA,IAAAC,EAAiBC,EAAQ,gCADzBC,EAAAC,EAAA,QAAAC,EAAAC,EAAkBJ,EAAY,aAA3CK,EAEMC,EAAAJ,EAAAK,yBADO,GAAAC,GAAAV,KAAAA,EAAA,IAAAC,EAAiBC,EAAQ,YAAAE,EAAAO,UAAAX,GADzB,IAAAU,GAAAL,KAAAA,EAAAC,EAAkBJ,EAAY,uEATxCA,EAAQ,IAAqB,SAAjBA,EAAY,IAAWU,EAAAV,KAQnCA,EAAQ,IAAqB,UAAjBA,EAAY,IAAYW,EAAAX,yCAXjCY,EAAWZ,EAAK,GAAEA,EAAI,IAAA,KAAIA,EAAQ,GAAG,cAAgB,IAAE,IAAGA,EAAS,IACvEA,EAAU,wFAQbA,EAAK,2CAdRK,EAqBGC,EAAAO,EAAAN,uHAbIP,EAAQ,IAAqB,SAAjBA,EAAY,kEAM5BA,EAAK,GAAAc,EAAA,iBAEDd,EAAQ,IAAqB,UAAjBA,EAAY,yHAXrBY,EAAWZ,EAAK,GAAEA,EAAI,IAAA,KAAIA,EAAQ,GAAG,cAAgB,IAAE,IAAGA,EAAS,KAAA,CAAAe,MAAAC,UACvEhB,EAAU,0DApCL,SAAAD,EAAiBkB,YACdA,gBAGH,SAAAb,EAAkBc,GACnB,MAAAC,GAAW,uBAEI,SAAjBD,GACFC,EAAQC,KAAK,uBAGM,UAAjBF,GACFC,EAAQC,KAAK,wBAERD,EAAQE,KAAK,cAGbT,EAAWU,EAAkBC,GAC9B,MAAAJ,GAAW,kBAEbG,GACFH,EAAQC,KAAI,YAAaE,KAEvBC,GACFJ,EAAQC,KAAI,YAAaG,KAEpBJ,EAAQE,KAAK,yIAzCXG,GAAaC,QACbC,GAAYD,UACZnB,GAAcmB,GACdH,MAAAA,GAA4BG,GAC5BE,SAAAA,GAAW,GAAKF,GAChBF,KAAAA,EAAiB,KAAGE,GACpBG,SAAAA,GAAwCH,GACxCP,aAAAA,GAAsDO,QAE3DI,EAAgBC,EAAqBC,yUAExCC,EAAA,EAAAC,EAAYR,EAAQV,WACpBmB,EAALC,OAAAC,UAAuBC,2BACXH,EAAWnB"}
1
+ {"version":3,"file":"Link.js","sources":["../../../../src/components/link/Link.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n import { get_current_component } from 'svelte/internal';\n import type { LinkIconPosition, LinkSize, LinkTheme } from './link.types';\n import { createEventForwarder } from '../../utilities/EventForward';\n export let label: string;\n export let href: string;\n export let target: string;\n export let theme: LinkTheme = undefined;\n export let disabled = false;\n export let size: LinkSize = 'm';\n export let iconname: string | undefined = undefined;\n export let iconposition: LinkIconPosition | undefined = undefined;\n\n const forwardEvents = createEventForwarder(get_current_component());\n\n $: userClass = $$props.class;\n $: attributes = { ...$$restProps };\n $: delete attributes.class;\n\n function generateIconName(iconName: string): string {\n return `${iconName} size=\"1rem\"`;\n }\n\n function generateIconClass(iconposition: string): string {\n const classes = ['mc-link__icon'];\n\n if (iconposition === 'left') {\n classes.push('mc-link__icon--left');\n }\n\n if (iconposition === 'right') {\n classes.push('mc-link__icon--right');\n }\n return classes.join(' ');\n }\n\n function setClasses(theme: LinkTheme, size: LinkSize): string {\n const classes = ['mc-link'];\n\n if (theme) {\n classes.push(`mc-link--${theme}`);\n }\n if (size) {\n classes.push(`mc-link--${size}`);\n }\n return classes.join(' ');\n }\n</script>\n\n<a\n use:forwardEvents\n on:click|stopPropagation\n {href}\n {target}\n class=\"{setClasses(theme, size)} {disabled ? 'is-disabled' : ''} {userClass}\"\n {...attributes}\n>\n {#if iconname && iconposition === 'left'}\n <span class={generateIconClass(iconposition)}>\n {@html `<${generateIconName(iconname)} />`}\n </span>\n {/if}\n\n {label}\n\n {#if iconname && iconposition === 'right'}\n <span class={generateIconClass(iconposition)}>\n {@html `<${generateIconName(iconname)} />`}\n </span>\n {/if}\n</a>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/_all-settings';\n @import '@mozaic-ds/styles/components/c.links';\n</style>\n"],"names":["raw_value","generateIconName","ctx","attr","span","span_class_value","generateIconClass","insert","target","anchor","dirty","innerHTML","create_if_block_1","create_if_block","setClasses","a","a_data","class","a_class_value","iconName","iconposition","classes","push","join","theme","size","label","$$props","href","disabled","iconname","forwardEvents","createEventForwarder","get_current_component","$$invalidate","userClass","attributes","Object","assign","$$restProps"],"mappings":"mRA6DiBA,EAAA,IAAAC,EAAiBC,EAAQ,gCADzBC,EAAAC,EAAA,QAAAC,EAAAC,EAAkBJ,EAAY,aAA3CK,EAEMC,EAAAJ,EAAAK,yBADO,GAAAC,GAAAV,KAAAA,EAAA,IAAAC,EAAiBC,EAAQ,YAAAE,EAAAO,UAAAX,GADzB,IAAAU,GAAAL,KAAAA,EAAAC,EAAkBJ,EAAY,2DAS9BF,EAAA,IAAAC,EAAiBC,EAAQ,gCADzBC,EAAAC,EAAA,QAAAC,EAAAC,EAAkBJ,EAAY,aAA3CK,EAEMC,EAAAJ,EAAAK,yBADO,GAAAC,GAAAV,KAAAA,EAAA,IAAAC,EAAiBC,EAAQ,YAAAE,EAAAO,UAAAX,GADzB,IAAAU,GAAAL,KAAAA,EAAAC,EAAkBJ,EAAY,uEATxCA,EAAQ,IAAqB,SAAjBA,EAAY,IAAWU,EAAAV,KAQnCA,EAAQ,IAAqB,UAAjBA,EAAY,IAAYW,EAAAX,yCAXjCY,EAAWZ,EAAK,GAAEA,EAAI,IAAA,KAAIA,EAAQ,GAAG,cAAgB,IAAE,IAAGA,EAAS,IACvEA,EAAU,wFAQbA,EAAK,2CAdRK,EAqBGC,EAAAO,EAAAN,0HAbIP,EAAQ,IAAqB,SAAjBA,EAAY,kEAM5BA,EAAK,GAAAc,EAAA,iBAEDd,EAAQ,IAAqB,UAAjBA,EAAY,yHAXrBY,EAAWZ,EAAK,GAAEA,EAAI,IAAA,KAAIA,EAAQ,GAAG,cAAgB,IAAE,IAAGA,EAAS,KAAA,CAAAe,MAAAC,UACvEhB,EAAU,0DApCL,SAAAD,EAAiBkB,YACdA,gBAGH,SAAAb,EAAkBc,GACnB,MAAAC,GAAW,uBAEI,SAAjBD,GACFC,EAAQC,KAAK,uBAGM,UAAjBF,GACFC,EAAQC,KAAK,wBAERD,EAAQE,KAAK,cAGbT,EAAWU,EAAkBC,GAC9B,MAAAJ,GAAW,kBAEbG,GACFH,EAAQC,KAAI,YAAaE,KAEvBC,GACFJ,EAAQC,KAAI,YAAaG,KAEpBJ,EAAQE,KAAK,yIAzCXG,GAAaC,QACbC,GAAYD,UACZnB,GAAcmB,GACdH,MAAAA,GAA4BG,GAC5BE,SAAAA,GAAW,GAAKF,GAChBF,KAAAA,EAAiB,KAAGE,GACpBG,SAAAA,GAAwCH,GACxCP,aAAAA,GAAsDO,QAE3DI,EAAgBC,EAAqBC,yUAExCC,EAAA,EAAAC,EAAYR,EAAQV,WACpBmB,EAALC,OAAAC,UAAuBC,2BACXH,EAAWnB"}
@@ -51,7 +51,7 @@
51
51
 
52
52
  <a
53
53
  use:forwardEvents
54
- on:click
54
+ on:click|stopPropagation
55
55
  {href}
56
56
  {target}
57
57
  class="{setClasses(theme, size)} {disabled ? 'is-disabled' : ''} {userClass}"