@baloise/ds-core 19.9.3 → 19.9.4

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 (141) hide show
  1. package/components/bal-accordion.js +0 -1
  2. package/components/bal-file-upload.js +5 -5
  3. package/components/index.js +1 -1
  4. package/components/swipe.subject.js +18 -0
  5. package/components/tokens.esm.js +1 -1
  6. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  7. package/dist/baloise-design-system/index.esm.js +1 -1
  8. package/dist/baloise-design-system/{p-ea9aa92049.entry.js → p-041bf35913.entry.js} +1 -1
  9. package/dist/baloise-design-system/{p-c47294e251.system.entry.js → p-1d8afd6f97.system.entry.js} +1 -1
  10. package/dist/baloise-design-system/{p-41a0556d46.entry.js → p-29d68d2132.entry.js} +1 -1
  11. package/dist/baloise-design-system/{p-ea38ac08ce.system.entry.js → p-353111ebe0.system.entry.js} +1 -1
  12. package/dist/baloise-design-system/{p-f647a73892.system.entry.js → p-36934c6f59.system.entry.js} +1 -1
  13. package/dist/baloise-design-system/{p-b585853436.system.entry.js → p-372ba2be28.system.entry.js} +1 -1
  14. package/dist/baloise-design-system/{p-818b880ec5.entry.js → p-3bb89f6a82.entry.js} +1 -1
  15. package/dist/baloise-design-system/{p-14475f12e8.entry.js → p-3c2762a456.entry.js} +1 -1
  16. package/dist/baloise-design-system/{p-3d9555be79.system.entry.js → p-47a709940f.system.entry.js} +1 -1
  17. package/dist/baloise-design-system/{p-370f98a376.entry.js → p-484747871b.entry.js} +1 -1
  18. package/dist/baloise-design-system/{p-239938cbc2.entry.js → p-495621ad03.entry.js} +1 -1
  19. package/dist/baloise-design-system/{p-BCtb7Ny9.system.js → p-4RgSLeC0.system.js} +1 -1
  20. package/dist/baloise-design-system/{p-14219e3845.entry.js → p-4f036f58ab.entry.js} +1 -1
  21. package/dist/baloise-design-system/{p-1e26da72e8.entry.js → p-50a9cbd963.entry.js} +1 -1
  22. package/dist/baloise-design-system/{p-8ea84ad7c7.entry.js → p-52c76f1bdd.entry.js} +1 -1
  23. package/dist/baloise-design-system/{p-83c6c17ed8.system.entry.js → p-608249b400.system.entry.js} +1 -1
  24. package/dist/baloise-design-system/{p-05221bf226.system.entry.js → p-6d9619c9d0.system.entry.js} +1 -1
  25. package/dist/baloise-design-system/{p-dd48a60d74.entry.js → p-72b37feadf.entry.js} +1 -1
  26. package/dist/baloise-design-system/{p-8bdcf69b1f.system.entry.js → p-813c277b9f.system.entry.js} +1 -1
  27. package/dist/baloise-design-system/p-8346d5f6ae.entry.js +1 -0
  28. package/dist/baloise-design-system/{p-a5f3b37e21.system.entry.js → p-8f06689f6a.system.entry.js} +1 -1
  29. package/dist/baloise-design-system/{p-03852c362f.entry.js → p-9871800426.entry.js} +1 -1
  30. package/dist/baloise-design-system/{p-7eec8c7a78.system.entry.js → p-9bf6adbd21.system.entry.js} +1 -1
  31. package/dist/baloise-design-system/p-B6GTvSSK.js +1 -0
  32. package/dist/baloise-design-system/p-BFRjY4w3.js +1 -1
  33. package/dist/baloise-design-system/p-BRAmUyPx.system.js +1 -1
  34. package/dist/baloise-design-system/{p-COFcDrAS.system.js → p-BhPUGxAx.system.js} +1 -1
  35. package/dist/baloise-design-system/p-Bk7UdnZ5.system.js +1 -1
  36. package/dist/baloise-design-system/{p-DUpGQx_U.system.js → p-CM1lc2ni.system.js} +1 -1
  37. package/dist/baloise-design-system/p-C_FHgwWW.js +1 -0
  38. package/dist/baloise-design-system/p-CviYHi5s.system.js +1 -0
  39. package/dist/baloise-design-system/{p-DlPc3plk.js → p-CwRoS0HB.js} +1 -1
  40. package/dist/baloise-design-system/{p-xlS5vO33.system.js → p-D5aEF_JU.system.js} +1 -1
  41. package/dist/baloise-design-system/{p-ZalPEZLa.js → p-DRqAN-8G.js} +1 -1
  42. package/dist/baloise-design-system/p-DwxDqMbM.system.js +1 -0
  43. package/dist/baloise-design-system/{p-ed56778833.system.entry.js → p-a0020dcf30.system.entry.js} +1 -1
  44. package/dist/baloise-design-system/{p-cef33e1117.entry.js → p-af292102b8.entry.js} +1 -1
  45. package/dist/baloise-design-system/{p-ee61799a11.system.entry.js → p-c900ad58d0.system.entry.js} +1 -1
  46. package/dist/baloise-design-system/{p-890c3ea355.system.entry.js → p-ccdbef8f33.system.entry.js} +1 -1
  47. package/dist/baloise-design-system/{p-01fdb2af3e.entry.js → p-d5de84380b.entry.js} +1 -1
  48. package/dist/baloise-design-system/{p-3bc249e38e.entry.js → p-e7a78b097d.entry.js} +1 -1
  49. package/dist/baloise-design-system/{p-9191e04f14.system.entry.js → p-f393662ba3.system.entry.js} +1 -1
  50. package/dist/baloise-design-system/{p-dd5caee1bb.system.entry.js → p-ff649f9b8a.system.entry.js} +1 -1
  51. package/dist/baloise-design-system/{p-CFZjZt-s.js → p-j8ENYrr7.js} +1 -1
  52. package/dist/cjs/bal-accordion_4.cjs.entry.js +0 -1
  53. package/dist/cjs/bal-carousel_2.cjs.entry.js +5 -5
  54. package/dist/cjs/bal-date-calendar_2.cjs.entry.js +2 -2
  55. package/dist/cjs/bal-field_5.cjs.entry.js +3 -3
  56. package/dist/cjs/bal-file-upload.cjs.entry.js +5 -5
  57. package/dist/cjs/bal-hint_5.cjs.entry.js +3 -3
  58. package/dist/cjs/bal-list_8.cjs.entry.js +3 -3
  59. package/dist/cjs/bal-logo.cjs.entry.js +3 -3
  60. package/dist/cjs/bal-nav_8.cjs.entry.js +3 -3
  61. package/dist/cjs/bal-navbar_5.cjs.entry.js +3 -3
  62. package/dist/cjs/bal-pagination.cjs.entry.js +3 -3
  63. package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
  64. package/dist/cjs/bal-segment_2.cjs.entry.js +4 -4
  65. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  66. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  67. package/dist/cjs/bal-tab-item_2.cjs.entry.js +5 -5
  68. package/dist/cjs/{breakpoints.decorator-DVSgAJPa.js → breakpoints.decorator-DIeNdkiK.js} +1 -1
  69. package/dist/cjs/{breakpoints.subject-PPg53GM5.js → breakpoints.subject-YppJaklV.js} +1 -1
  70. package/dist/cjs/index.cjs.js +3 -3
  71. package/dist/cjs/initialize-BzrcZo6Y.js +1 -1
  72. package/dist/cjs/{swipe.decorator-BZYUlkYt.js → swipe.decorator-C_jX7Il5.js} +1 -1
  73. package/dist/cjs/{swipe.subject-BaKNugDQ.js → swipe.subject-iyL-XVHG.js} +18 -0
  74. package/dist/cjs/{tokens.esm-B1kdQjzR.js → tokens.esm-CGjXTIYw.js} +1 -1
  75. package/dist/cjs/{window-resize.decorator-DHvgxiqB.js → window-resize.decorator-CnkxxD9I.js} +1 -1
  76. package/dist/collection/components/bal-accordion/bal-accordion.js +2 -6
  77. package/dist/collection/components/bal-file-upload/bal-file-upload.js +5 -5
  78. package/dist/collection/utils/constants/version.constant.js +1 -1
  79. package/dist/collection/utils/swipe/swipe.listener.js +19 -0
  80. package/dist/esm/bal-accordion_4.entry.js +0 -1
  81. package/dist/esm/bal-carousel_2.entry.js +5 -5
  82. package/dist/esm/bal-date-calendar_2.entry.js +2 -2
  83. package/dist/esm/bal-field_5.entry.js +3 -3
  84. package/dist/esm/bal-file-upload.entry.js +5 -5
  85. package/dist/esm/bal-hint_5.entry.js +3 -3
  86. package/dist/esm/bal-list_8.entry.js +3 -3
  87. package/dist/esm/bal-logo.entry.js +3 -3
  88. package/dist/esm/bal-nav_8.entry.js +3 -3
  89. package/dist/esm/bal-navbar_5.entry.js +3 -3
  90. package/dist/esm/bal-pagination.entry.js +3 -3
  91. package/dist/esm/bal-progress-bar.entry.js +4 -4
  92. package/dist/esm/bal-segment_2.entry.js +4 -4
  93. package/dist/esm/bal-shape.entry.js +1 -1
  94. package/dist/esm/bal-steps.entry.js +3 -3
  95. package/dist/esm/bal-tab-item_2.entry.js +5 -5
  96. package/dist/esm/{breakpoints.decorator-CJwbnRPE.js → breakpoints.decorator-CLJL1mrw.js} +1 -1
  97. package/dist/esm/{breakpoints.subject-CKmK7JA0.js → breakpoints.subject-CaVH5CdH.js} +1 -1
  98. package/dist/esm/index.js +4 -4
  99. package/dist/esm/initialize-W3od-FM9.js +1 -1
  100. package/dist/esm/{swipe.decorator-B_Ghrp1o.js → swipe.decorator-B-pmjyNr.js} +1 -1
  101. package/dist/esm/{swipe.subject-T0VStuOK.js → swipe.subject-BXuaiulg.js} +18 -0
  102. package/dist/esm/{tokens.esm-DTyLTqMF.js → tokens.esm-PSBwy3yf.js} +1 -1
  103. package/dist/esm/{window-resize.decorator-xoiS5CvH.js → window-resize.decorator-B6C5v87J.js} +1 -1
  104. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  105. package/dist/esm-es5/bal-date-calendar_2.entry.js +1 -1
  106. package/dist/esm-es5/bal-field_5.entry.js +1 -1
  107. package/dist/esm-es5/bal-file-upload.entry.js +1 -1
  108. package/dist/esm-es5/bal-hint_5.entry.js +1 -1
  109. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  110. package/dist/esm-es5/bal-logo.entry.js +1 -1
  111. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  112. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  113. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  114. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  115. package/dist/esm-es5/bal-segment_2.entry.js +1 -1
  116. package/dist/esm-es5/bal-shape.entry.js +1 -1
  117. package/dist/esm-es5/bal-steps.entry.js +1 -1
  118. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  119. package/dist/esm-es5/{breakpoints.decorator-CJwbnRPE.js → breakpoints.decorator-CLJL1mrw.js} +1 -1
  120. package/dist/esm-es5/{breakpoints.subject-CKmK7JA0.js → breakpoints.subject-CaVH5CdH.js} +1 -1
  121. package/dist/esm-es5/index.js +1 -1
  122. package/dist/esm-es5/initialize-W3od-FM9.js +1 -1
  123. package/dist/esm-es5/{swipe.decorator-B_Ghrp1o.js → swipe.decorator-B-pmjyNr.js} +1 -1
  124. package/dist/esm-es5/swipe.subject-BXuaiulg.js +1 -0
  125. package/dist/esm-es5/{window-resize.decorator-xoiS5CvH.js → window-resize.decorator-B6C5v87J.js} +1 -1
  126. package/dist/html.html-data.json +4 -0
  127. package/dist/types/components/bal-accordion/bal-accordion.d.ts +0 -1
  128. package/dist/types/components.d.ts +6 -0
  129. package/dist/types/utils/swipe/swipe.listener.d.ts +1 -0
  130. package/package.json +6 -6
  131. package/dist/baloise-design-system/p-0g14KuPx.system.js +0 -1
  132. package/dist/baloise-design-system/p-CHTPLy3W.system.js +0 -1
  133. package/dist/baloise-design-system/p-CeIZ5hSt.js +0 -1
  134. package/dist/baloise-design-system/p-TGlXe_VY.js +0 -1
  135. package/dist/baloise-design-system/p-fb2960c1b6.entry.js +0 -1
  136. package/dist/esm-es5/swipe.subject-T0VStuOK.js +0 -1
  137. /package/dist/baloise-design-system/{p-68c75901a4.system.entry.js → p-67f2a7fbef.system.entry.js} +0 -0
  138. /package/dist/baloise-design-system/{p-7563a0a66d.entry.js → p-692f76ee0c.entry.js} +0 -0
  139. /package/dist/baloise-design-system/{p-1D6CbirM.system.js → p-BJHY1rVR.system.js} +0 -0
  140. /package/dist/baloise-design-system/{p-DTyLTqMF.js → p-PSBwy3yf.js} +0 -0
  141. /package/dist/esm-es5/{tokens.esm-DTyLTqMF.js → tokens.esm-PSBwy3yf.js} +0 -0
@@ -1 +1 @@
1
- import{__awaiter,__extends,__generator}from"tslib";import{a as setPlatformHelpers}from"./index-BdVwMG9u.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{f as waitForComponent}from"./helpers-BNj87EbG.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";var BALOISE_ANIMATION_KEY="baloise-animated";var Config=function(){function t(){this._componentObservers=[];this._observers=[];this._config=defaultConfig}Object.defineProperty(t.prototype,"locale",{get:function(){return"".concat(this._config.language,"-").concat(this._config.region)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"region",{get:function(){return this._config.region},set:function(t){if(t!==this._config.region){this._config.region=t;this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"language",{get:function(){return this._config.language},set:function(t){if(t!==this._config.language){if(this._config.allowedLanguages.includes(t)){this._config.language=t}else{this._config.language=this._config.fallbackLanguage}this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"brand",{get:function(){return this._config.brand},set:function(t){if(t!==this._config.brand){this._config.brand=t;this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allowedLanguages",{get:function(){return this._config.allowedLanguages},set:function(t){if(t!==this._config.allowedLanguages){this._config.allowedLanguages=t;this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"icons",{get:function(){return this._config.icons},set:function(t){this._config.icons=Object.assign(Object.assign({},this._config.icons),t);this._notify()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"logger",{get:function(){return this._config.logger},set:function(t){this._config.logger=Object.assign({},t);this._notify()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"animated",{get:function(){return this._config.animated},set:function(t){this._config.animated=t;this._notify()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"httpFormSubmit",{get:function(){return this._config.httpFormSubmit},set:function(t){this._config.httpFormSubmit=t;this._notify()},enumerable:false,configurable:true});t.prototype.attach=function(t){var e=this._observers.includes(t);if(e){return console.log("Subject: Observer has been attached already.")}this._observers.push(t);t.configChanged(this._config)};t.prototype.detach=function(t){var e=this._observers.indexOf(t);if(e===-1){return console.log("Subject: Nonexistent observer.")}this._observers.splice(e,1)};t.prototype.attachComponent=function(t){var e=this._componentObservers.includes(t);if(e){return console.log("Subject: Observer has been attached already.")}this._componentObservers.push(t);t.configChanged(this._config)};t.prototype.detachComponent=function(t){var e=this._componentObservers.indexOf(t);if(e===-1){return console.log("Subject: Nonexistent observer.")}this._componentObservers.splice(e,1)};t.prototype.toString=function(){return JSON.stringify(this._config)};t.prototype.reset=function(t){this._config=Object.assign(Object.assign(Object.assign({},this._config),t),{icons:Object.assign(Object.assign({},this._config.icons),t.icons)});this._notify(false)};t.prototype._notify=function(t){if(t===void 0){t=true}for(var e=0,a=this._componentObservers;e<a.length;e++){var i=a[e];i.configChanged(this._config)}if(t){for(var n=0,r=this._observers;n<r.length;n++){var i=r[n];i.configChanged(this._config)}}};return t}();var config=new Config;var configFromLocalStorage=function(t){try{var e=JSON.parse(t.localStorage.getItem(BALOISE_ANIMATION_KEY));if(e!==null){return{animated:e}}return{}}catch(t){return{}}};var setupConfig=function(t,e){if(t===void 0){t={}}if(e===void 0){e={}}if(Object.keys(e).length===0&&balBrowser.hasWindow){e=window}e.BaloiseDesignSystem=e.BaloiseDesignSystem||{};config.reset(Object.assign(Object.assign(Object.assign({},configFromLocalStorage(e)),t),{icons:Object.assign({},t.icons)}));e.BaloiseDesignSystem.config=config};var BalNoticeController=function(){function t(t){this.options=t;this.container=null;this.queue=[];this.preQueue=[];this.queueLimit=5}t.prototype.create=function(t){var e=this;if(balBrowser.hasDocument){this.setupContainer(t);var a=this.findClone(t);if(a===undefined){var i=document.createElement(this.options.tag);Object.assign(i,t);i.addEventListener("balClose",(function(t){e.removeFromQueue(t.detail)}));this.preQueue.push(i);this.updateQueue();return i}return a}};t.prototype.setQueue=function(t){this.queueLimit=t};t.prototype.dismissAll=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,a,i,n;return __generator(this,(function(r){switch(r.label){case 0:e=(t=this.container)===null||t===void 0?void 0:t.querySelectorAll(this.options.tag);if(!e)return[3,2];a=[];for(i=0;i<e.length;i++){n=e[i];if(n.close){a.push(n.close())}}return[4,Promise.all(a)];case 1:r.sent();r.label=2;case 2:return[2]}}))}))};t.prototype.clearAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){console.warn("[DEPRECATED] - use dismissAll() instead");return[2,this.dismissAll()]}))}))};t.prototype.findClone=function(t){for(var e=0;e<this.queue.length;e++){var a=this.queue[e];if(a.message===t.message&&a.color===t.color){return a}}return undefined};t.prototype.setupContainer=function(t){if(balBrowser.hasDocument){var e="".concat(this.options.tag,"-container");this.container=document.getElementById(e);if(this.container)return;if(!this.container){this.container=document.createElement("bal-notices");this.container.setAttribute("interface",this.options.tag.replace("bal-",""));this.container.setAttribute("animated",t.animated?"true":"false");if(t.container!==undefined){this.container.setAttribute("container",t.container===true?"":t.container)}this.container.id=e}document.body.appendChild(this.container)}};t.prototype.updateQueue=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,a;return __generator(this,(function(i){switch(i.label){case 0:if(!(this.queue.length<this.queueLimit))return[3,2];e=this.preQueue.shift();if(!(e&&this.container))return[3,2];return[4,waitForComponent(this.container)];case 1:i.sent();a=this.container.querySelector(".bal-notices__inner");if(a){this.queue.push(e);a.insertAdjacentElement("beforeend",e)}i.label=2;case 2:if(this.queue.length===0){(t=this.container)===null||t===void 0?void 0:t.remove()}return[2]}}))}))};t.prototype.removeFromQueue=function(t){var e=this;this.queue=this.queue.filter((function(e){return e.id!==t}));setTimeout((function(){return e.updateQueue()}),0)};return t}();var BalSnackbarController=function(t){__extends(e,t);function e(){return t.call(this,{tag:"bal-snackbar"})||this}e.prototype.create=function(e){return t.prototype.create.call(this,e)};return e}(BalNoticeController);var balSnackbarController=new BalSnackbarController;var BalToastController=function(t){__extends(e,t);function e(){return t.call(this,{tag:"bal-toast"})||this}e.prototype.create=function(e){return t.prototype.create.call(this,e)};return e}(BalNoticeController);var balToastController=new BalToastController;var tags=["bal-accordion","bal-accordion-details","bal-accordion-summary","bal-accordion-trigger","bal-app","bal-badge","bal-button","bal-button-group","bal-card","bal-card-actions","bal-card-button","bal-card-content","bal-card-subtitle","bal-card-title","bal-carousel","bal-carousel-item","bal-check","bal-checkbox","bal-checkbox-group","bal-close","bal-content","bal-data","bal-data-item","bal-data-label","bal-data-value","bal-date","bal-date-calendar","bal-date-calendar-cell","bal-divider","bal-dropdown","bal-field","bal-field-control","bal-field-hint","bal-field-label","bal-field-message","bal-file-upload","bal-footer","bal-form","bal-form-col","bal-form-grid","bal-heading","bal-hint","bal-hint-text","bal-hint-title","bal-icon","bal-input","bal-input-date","bal-input-group","bal-input-slider","bal-input-stepper","bal-label","bal-list","bal-list-item","bal-list-item-accordion-body","bal-list-item-accordion-head","bal-list-item-content","bal-list-item-icon","bal-list-item-subtitle","bal-list-item-title","bal-logo","bal-modal","bal-modal-body","bal-modal-header","bal-nav","bal-nav-link","bal-nav-link-grid","bal-nav-link-grid-col","bal-nav-link-group","bal-nav-menu-bar","bal-nav-menu-flyout","bal-nav-meta-bar","bal-navbar","bal-navbar-brand","bal-navbar-menu","bal-navbar-menu-end","bal-navbar-menu-start","bal-notices","bal-notification","bal-number-input","bal-option","bal-option-list","bal-pagination","bal-popover","bal-popover-content","bal-popup","bal-progress-bar","bal-radio","bal-radio-group","bal-radio-icon","bal-segment","bal-segment-item","bal-select","bal-select-option","bal-shape","bal-sheet","bal-snackbar","bal-spinner","bal-stack","bal-stage","bal-stage-back-link","bal-stage-body","bal-stage-foot","bal-stage-head","bal-stage-image","bal-step-item","bal-steps","bal-switch","bal-tab-item","bal-table","bal-tabs","bal-tag","bal-tag-group","bal-text","bal-textarea","bal-time-input","bal-toast","bal-tooltip"];var VERSION="19.9.3";var initializeBaloiseDesignSystem=function(t,e,a){if(t===void 0){t={}}if(e===void 0){e=undefined}if(a===void 0){a={}}if(Object.keys(a).length===0&&balBrowser.hasWindow){a=window}a.BaloiseDesignSystem=a.BaloiseDesignSystem||{};if(e){setPlatformHelpers(e)}setupConfig(Object.assign(Object.assign({},t),e),a);a.BaloiseDesignSystem.toastController=balToastController;a.BaloiseDesignSystem.snackbarController=balSnackbarController;a.BaloiseDesignSystem.initialize=function(){return setupConfig(a.BaloiseDesignSystem.config,a)};a.BaloiseDesignSystem.version=VERSION;if(t._generateHydrateForCustomElementsOutput){generateHydrateForCustomElementsOutput(tags)}};var generateHydrateForCustomElementsOutput=function(t){if(t===void 0){t=[]}var e="slot-fb{display:contents}slot-fb[hidden]{display:none}";var a="{visibility:hidden}.hydrated{visibility:inherit}";var i=typeof window!=="undefined"?window:{};if(!i.document){console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");return}var n=i.document.head;var r=n.querySelector("meta[charset]");var o=i.document.createElement("style");if(t.length>0){o.textContent+=e;o.textContent+=t.sort()+a;if(o.innerHTML.length){o.setAttribute("data-styles","");n.insertBefore(o,r?r.nextSibling:n.firstChild)}}};export{BalSnackbarController as B,BalToastController as a,balSnackbarController as b,balToastController as c,initializeBaloiseDesignSystem as i,setupConfig as s};
1
+ import{__awaiter,__extends,__generator}from"tslib";import{a as setPlatformHelpers}from"./index-BdVwMG9u.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{f as waitForComponent}from"./helpers-BNj87EbG.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";var BALOISE_ANIMATION_KEY="baloise-animated";var Config=function(){function t(){this._componentObservers=[];this._observers=[];this._config=defaultConfig}Object.defineProperty(t.prototype,"locale",{get:function(){return"".concat(this._config.language,"-").concat(this._config.region)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"region",{get:function(){return this._config.region},set:function(t){if(t!==this._config.region){this._config.region=t;this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"language",{get:function(){return this._config.language},set:function(t){if(t!==this._config.language){if(this._config.allowedLanguages.includes(t)){this._config.language=t}else{this._config.language=this._config.fallbackLanguage}this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"brand",{get:function(){return this._config.brand},set:function(t){if(t!==this._config.brand){this._config.brand=t;this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allowedLanguages",{get:function(){return this._config.allowedLanguages},set:function(t){if(t!==this._config.allowedLanguages){this._config.allowedLanguages=t;this._notify()}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"icons",{get:function(){return this._config.icons},set:function(t){this._config.icons=Object.assign(Object.assign({},this._config.icons),t);this._notify()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"logger",{get:function(){return this._config.logger},set:function(t){this._config.logger=Object.assign({},t);this._notify()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"animated",{get:function(){return this._config.animated},set:function(t){this._config.animated=t;this._notify()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"httpFormSubmit",{get:function(){return this._config.httpFormSubmit},set:function(t){this._config.httpFormSubmit=t;this._notify()},enumerable:false,configurable:true});t.prototype.attach=function(t){var e=this._observers.includes(t);if(e){return console.log("Subject: Observer has been attached already.")}this._observers.push(t);t.configChanged(this._config)};t.prototype.detach=function(t){var e=this._observers.indexOf(t);if(e===-1){return console.log("Subject: Nonexistent observer.")}this._observers.splice(e,1)};t.prototype.attachComponent=function(t){var e=this._componentObservers.includes(t);if(e){return console.log("Subject: Observer has been attached already.")}this._componentObservers.push(t);t.configChanged(this._config)};t.prototype.detachComponent=function(t){var e=this._componentObservers.indexOf(t);if(e===-1){return console.log("Subject: Nonexistent observer.")}this._componentObservers.splice(e,1)};t.prototype.toString=function(){return JSON.stringify(this._config)};t.prototype.reset=function(t){this._config=Object.assign(Object.assign(Object.assign({},this._config),t),{icons:Object.assign(Object.assign({},this._config.icons),t.icons)});this._notify(false)};t.prototype._notify=function(t){if(t===void 0){t=true}for(var e=0,a=this._componentObservers;e<a.length;e++){var i=a[e];i.configChanged(this._config)}if(t){for(var n=0,r=this._observers;n<r.length;n++){var i=r[n];i.configChanged(this._config)}}};return t}();var config=new Config;var configFromLocalStorage=function(t){try{var e=JSON.parse(t.localStorage.getItem(BALOISE_ANIMATION_KEY));if(e!==null){return{animated:e}}return{}}catch(t){return{}}};var setupConfig=function(t,e){if(t===void 0){t={}}if(e===void 0){e={}}if(Object.keys(e).length===0&&balBrowser.hasWindow){e=window}e.BaloiseDesignSystem=e.BaloiseDesignSystem||{};config.reset(Object.assign(Object.assign(Object.assign({},configFromLocalStorage(e)),t),{icons:Object.assign({},t.icons)}));e.BaloiseDesignSystem.config=config};var BalNoticeController=function(){function t(t){this.options=t;this.container=null;this.queue=[];this.preQueue=[];this.queueLimit=5}t.prototype.create=function(t){var e=this;if(balBrowser.hasDocument){this.setupContainer(t);var a=this.findClone(t);if(a===undefined){var i=document.createElement(this.options.tag);Object.assign(i,t);i.addEventListener("balClose",(function(t){e.removeFromQueue(t.detail)}));this.preQueue.push(i);this.updateQueue();return i}return a}};t.prototype.setQueue=function(t){this.queueLimit=t};t.prototype.dismissAll=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,a,i,n;return __generator(this,(function(r){switch(r.label){case 0:e=(t=this.container)===null||t===void 0?void 0:t.querySelectorAll(this.options.tag);if(!e)return[3,2];a=[];for(i=0;i<e.length;i++){n=e[i];if(n.close){a.push(n.close())}}return[4,Promise.all(a)];case 1:r.sent();r.label=2;case 2:return[2]}}))}))};t.prototype.clearAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){console.warn("[DEPRECATED] - use dismissAll() instead");return[2,this.dismissAll()]}))}))};t.prototype.findClone=function(t){for(var e=0;e<this.queue.length;e++){var a=this.queue[e];if(a.message===t.message&&a.color===t.color){return a}}return undefined};t.prototype.setupContainer=function(t){if(balBrowser.hasDocument){var e="".concat(this.options.tag,"-container");this.container=document.getElementById(e);if(this.container)return;if(!this.container){this.container=document.createElement("bal-notices");this.container.setAttribute("interface",this.options.tag.replace("bal-",""));this.container.setAttribute("animated",t.animated?"true":"false");if(t.container!==undefined){this.container.setAttribute("container",t.container===true?"":t.container)}this.container.id=e}document.body.appendChild(this.container)}};t.prototype.updateQueue=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,a;return __generator(this,(function(i){switch(i.label){case 0:if(!(this.queue.length<this.queueLimit))return[3,2];e=this.preQueue.shift();if(!(e&&this.container))return[3,2];return[4,waitForComponent(this.container)];case 1:i.sent();a=this.container.querySelector(".bal-notices__inner");if(a){this.queue.push(e);a.insertAdjacentElement("beforeend",e)}i.label=2;case 2:if(this.queue.length===0){(t=this.container)===null||t===void 0?void 0:t.remove()}return[2]}}))}))};t.prototype.removeFromQueue=function(t){var e=this;this.queue=this.queue.filter((function(e){return e.id!==t}));setTimeout((function(){return e.updateQueue()}),0)};return t}();var BalSnackbarController=function(t){__extends(e,t);function e(){return t.call(this,{tag:"bal-snackbar"})||this}e.prototype.create=function(e){return t.prototype.create.call(this,e)};return e}(BalNoticeController);var balSnackbarController=new BalSnackbarController;var BalToastController=function(t){__extends(e,t);function e(){return t.call(this,{tag:"bal-toast"})||this}e.prototype.create=function(e){return t.prototype.create.call(this,e)};return e}(BalNoticeController);var balToastController=new BalToastController;var tags=["bal-accordion","bal-accordion-details","bal-accordion-summary","bal-accordion-trigger","bal-app","bal-badge","bal-button","bal-button-group","bal-card","bal-card-actions","bal-card-button","bal-card-content","bal-card-subtitle","bal-card-title","bal-carousel","bal-carousel-item","bal-check","bal-checkbox","bal-checkbox-group","bal-close","bal-content","bal-data","bal-data-item","bal-data-label","bal-data-value","bal-date","bal-date-calendar","bal-date-calendar-cell","bal-divider","bal-dropdown","bal-field","bal-field-control","bal-field-hint","bal-field-label","bal-field-message","bal-file-upload","bal-footer","bal-form","bal-form-col","bal-form-grid","bal-heading","bal-hint","bal-hint-text","bal-hint-title","bal-icon","bal-input","bal-input-date","bal-input-group","bal-input-slider","bal-input-stepper","bal-label","bal-list","bal-list-item","bal-list-item-accordion-body","bal-list-item-accordion-head","bal-list-item-content","bal-list-item-icon","bal-list-item-subtitle","bal-list-item-title","bal-logo","bal-modal","bal-modal-body","bal-modal-header","bal-nav","bal-nav-link","bal-nav-link-grid","bal-nav-link-grid-col","bal-nav-link-group","bal-nav-menu-bar","bal-nav-menu-flyout","bal-nav-meta-bar","bal-navbar","bal-navbar-brand","bal-navbar-menu","bal-navbar-menu-end","bal-navbar-menu-start","bal-notices","bal-notification","bal-number-input","bal-option","bal-option-list","bal-pagination","bal-popover","bal-popover-content","bal-popup","bal-progress-bar","bal-radio","bal-radio-group","bal-radio-icon","bal-segment","bal-segment-item","bal-select","bal-select-option","bal-shape","bal-sheet","bal-snackbar","bal-spinner","bal-stack","bal-stage","bal-stage-back-link","bal-stage-body","bal-stage-foot","bal-stage-head","bal-stage-image","bal-step-item","bal-steps","bal-switch","bal-tab-item","bal-table","bal-tabs","bal-tag","bal-tag-group","bal-text","bal-textarea","bal-time-input","bal-toast","bal-tooltip"];var VERSION="19.9.4";var initializeBaloiseDesignSystem=function(t,e,a){if(t===void 0){t={}}if(e===void 0){e=undefined}if(a===void 0){a={}}if(Object.keys(a).length===0&&balBrowser.hasWindow){a=window}a.BaloiseDesignSystem=a.BaloiseDesignSystem||{};if(e){setPlatformHelpers(e)}setupConfig(Object.assign(Object.assign({},t),e),a);a.BaloiseDesignSystem.toastController=balToastController;a.BaloiseDesignSystem.snackbarController=balSnackbarController;a.BaloiseDesignSystem.initialize=function(){return setupConfig(a.BaloiseDesignSystem.config,a)};a.BaloiseDesignSystem.version=VERSION;if(t._generateHydrateForCustomElementsOutput){generateHydrateForCustomElementsOutput(tags)}};var generateHydrateForCustomElementsOutput=function(t){if(t===void 0){t=[]}var e="slot-fb{display:contents}slot-fb[hidden]{display:none}";var a="{visibility:hidden}.hydrated{visibility:inherit}";var i=typeof window!=="undefined"?window:{};if(!i.document){console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");return}var n=i.document.head;var r=n.querySelector("meta[charset]");var o=i.document.createElement("style");if(t.length>0){o.textContent+=e;o.textContent+=t.sort()+a;if(o.innerHTML.length){o.setAttribute("data-styles","");n.insertBefore(o,r?r.nextSibling:n.firstChild)}}};export{BalSnackbarController as B,BalToastController as a,balSnackbarController as b,balToastController as c,initializeBaloiseDesignSystem as i,setupConfig as s};
@@ -1 +1 @@
1
- import{B as BalSwipeSubject}from"./swipe.subject-T0VStuOK.js";function ListenToSwipe(i){if(i===void 0){i={mobileOnly:false}}return function(t,e,n){var s=t.connectedCallback,u=t.disconnectedCallback;t.connectedCallback=function(){if(!this._balSwipeSubject){this._balSwipeSubject=new BalSwipeSubject(i);this._balSwipeSubject.attach(this)}return s&&s.call(this)};t.disconnectedCallback=function(){if(this._balSwipeSubject){this._balSwipeSubject.detach();this._balSwipeSubject=undefined}return u&&u.call(this)}}}export{ListenToSwipe as L};
1
+ import{B as BalSwipeSubject}from"./swipe.subject-BXuaiulg.js";function ListenToSwipe(i){if(i===void 0){i={mobileOnly:false}}return function(t,e,n){var s=t.connectedCallback,u=t.disconnectedCallback;t.connectedCallback=function(){if(!this._balSwipeSubject){this._balSwipeSubject=new BalSwipeSubject(i);this._balSwipeSubject.attach(this)}return s&&s.call(this)};t.disconnectedCallback=function(){if(this._balSwipeSubject){this._balSwipeSubject.detach();this._balSwipeSubject=undefined}return u&&u.call(this)}}}export{ListenToSwipe as L};
@@ -0,0 +1 @@
1
+ import{__awaiter,__extends,__generator}from"tslib";import{b as balDevice}from"./device-TtMibDFL.js";import{L as ListenerAbstract,a as SingleSubject}from"./listener-CClDIhvK.js";import{l as rOnLoad}from"./helpers-BNj87EbG.js";var BalSwipeListener=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}i.prototype.connect=function(i){return __awaiter(this,void 0,void 0,(function(){var n=this;return __generator(this,(function(e){switch(e.label){case 0:t.prototype.connect.call(this,i);return[4,this.loadLib()];case 1:e.sent();if(this.PointerListenerLib){this.pointerListener=new this.PointerListenerLib(i,{handleTouchEvents:false});this.shadowFixPointerDownListener=function(t){var n=t.target;if(n&&n!==i&&n.shadowRoot){n.releasePointerCapture(t.pointerId)}};i.addEventListener("pointerdown",this.shadowFixPointerDownListener);this.pointerListener.on("swipeleft",(function(){return n.notify({left:true,right:false})}));this.pointerListener.on("swiperight",(function(){return n.notify({left:false,right:true})}))}return[2]}}))}))};i.prototype.disconnect=function(){var i;if(this.shadowFixPointerDownListener&&this.el){this.el.removeEventListener("pointerdown",this.shadowFixPointerDownListener);this.shadowFixPointerDownListener=undefined}t.prototype.disconnect.call(this);(i=this.pointerListener)===null||i===void 0?void 0:i.destroy()};i.prototype.loadLib=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){return[2,new Promise((function(i,n){rOnLoad((function(){return __awaiter(t,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){import("./contact-BkEdlCZJ.js").then((function(n){t.PointerListenerLib=n.PointerListener;i()})).catch(n);return[2]}))}))}))}))]}))}))};return i}(ListenerAbstract);var BalSwipeSubject=function(t){__extends(i,t);function i(i){if(i===void 0){i={mobileOnly:false}}var n=t.call(this,(function(t,i){if(i){t.swipeListener(i)}}))||this;n.options=i;n.listener=new BalSwipeListener;return n}i.prototype.attach=function(i){var n=this;if(this.options.mobileOnly===true&&balDevice.isMobile||this.options.mobileOnly!==true){t.prototype.attach.call(this,i);this.listener.connect(i.el);this.listener.add((function(i){return t.prototype.notify.call(n,i)}))}};i.prototype.detach=function(){t.prototype.detach.call(this);this.listener.disconnect()};return i}(SingleSubject);export{BalSwipeSubject as B};
@@ -1 +1 @@
1
- import{__extends}from"tslib";import{B as BalWindowResizeListener}from"./breakpoints.subject-CKmK7JA0.js";import{a as SingleSubject}from"./listener-CClDIhvK.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";var BalWindowResizeSubject=function(i){__extends(t,i);function t(){var t=i.call(this,(function(i,t){i.windowResizeListener()}))||this;t.listener=new BalWindowResizeListener;return t}t.prototype.attach=function(t){var e=this;i.prototype.attach.call(this,t);if(balBrowser.hasWindow){this.listener.connect(window);this.listener.add((function(){return i.prototype.notify.call(e)}))}};t.prototype.detach=function(){i.prototype.detach.call(this);this.listener.disconnect()};return t}(SingleSubject);new BalWindowResizeSubject;function ListenToWindowResize(){return function(i,t,e){var n=i.connectedCallback,s=i.disconnectedCallback;i.connectedCallback=function(){if(!this._balWindowResizeSubject){this._balWindowResizeSubject=new BalWindowResizeSubject;this._balWindowResizeSubject.attach(this)}return n&&n.call(this)};i.disconnectedCallback=function(){if(this._balWindowResizeSubject){this._balWindowResizeSubject.detach();this._balWindowResizeSubject=undefined}return s&&s.call(this)}}}export{ListenToWindowResize as L};
1
+ import{__extends}from"tslib";import{B as BalWindowResizeListener}from"./breakpoints.subject-CaVH5CdH.js";import{a as SingleSubject}from"./listener-CClDIhvK.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";var BalWindowResizeSubject=function(i){__extends(t,i);function t(){var t=i.call(this,(function(i,t){i.windowResizeListener()}))||this;t.listener=new BalWindowResizeListener;return t}t.prototype.attach=function(t){var e=this;i.prototype.attach.call(this,t);if(balBrowser.hasWindow){this.listener.connect(window);this.listener.add((function(){return i.prototype.notify.call(e)}))}};t.prototype.detach=function(){i.prototype.detach.call(this);this.listener.disconnect()};return t}(SingleSubject);new BalWindowResizeSubject;function ListenToWindowResize(){return function(i,t,e){var n=i.connectedCallback,s=i.disconnectedCallback;i.connectedCallback=function(){if(!this._balWindowResizeSubject){this._balWindowResizeSubject=new BalWindowResizeSubject;this._balWindowResizeSubject.attach(this)}return n&&n.call(this)};i.disconnectedCallback=function(){if(this._balWindowResizeSubject){this._balWindowResizeSubject.detach();this._balWindowResizeSubject=undefined}return s&&s.call(this)}}}export{ListenToWindowResize as L};
@@ -35,6 +35,10 @@
35
35
  {
36
36
  "name": "open-label",
37
37
  "description": "Label of the open trigger button"
38
+ },
39
+ {
40
+ "name": "version",
41
+ "description": "defines the version of the component"
38
42
  }
39
43
  ],
40
44
  "references": [
@@ -50,7 +50,6 @@ export declare class Accordion implements ComponentInterface, BalConfigObserver,
50
50
  */
51
51
  card: boolean;
52
52
  /**
53
- * @internal
54
53
  * defines the version of the component
55
54
  */
56
55
  version: number;
@@ -85,6 +85,7 @@ export namespace Components {
85
85
  */
86
86
  "toggle": () => Promise<boolean>;
87
87
  /**
88
+ * defines the version of the component
88
89
  * @default 2
89
90
  */
90
91
  "version": number;
@@ -6071,6 +6072,11 @@ declare namespace LocalJSX {
6071
6072
  * @default ''
6072
6073
  */
6073
6074
  "openLabel"?: string;
6075
+ /**
6076
+ * defines the version of the component
6077
+ * @default 2
6078
+ */
6079
+ "version"?: number;
6074
6080
  }
6075
6081
  interface BalAccordionDetails {
6076
6082
  }
@@ -4,6 +4,7 @@ import { BalSwipeInfo } from './swipe.interfaces';
4
4
  export declare class BalSwipeListener<TObserver> extends ListenerAbstract<TObserver, BalSwipeInfo> {
5
5
  private PointerListenerLib;
6
6
  private pointerListener;
7
+ private shadowFixPointerDownListener?;
7
8
  connect(el: HTMLElement | HTMLStencilElement): Promise<void>;
8
9
  disconnect(): void;
9
10
  private loadLib;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baloise/ds-core",
3
- "version": "19.9.3",
3
+ "version": "19.9.4",
4
4
  "description": "The Baloise Design-System is an open source project for styling awesome web applications that follow the Baloise corporate styling guidelines.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,8 +28,8 @@
28
28
  "test:ui": "vitest --ui"
29
29
  },
30
30
  "dependencies": {
31
- "@baloise/ds-styles": "19.9.3",
32
- "@baloise/ds-icons": "19.9.3",
31
+ "@baloise/ds-styles": "19.9.4",
32
+ "@baloise/ds-icons": "19.9.4",
33
33
  "@baloise/web-app-utils": "3.15.0",
34
34
  "@floating-ui/dom": "~1.6.3",
35
35
  "@popperjs/core": "~2.11.4",
@@ -53,9 +53,9 @@
53
53
  "devDependencies": {
54
54
  "@baloise/output-target-angular": "0.0.0",
55
55
  "@baloise/output-target-web": "0.0.0",
56
- "@baloise/ds-maps": "19.9.3",
57
- "@baloise/ds-brand-icons": "19.9.3",
58
- "@baloise/ds-favicons": "19.9.3",
56
+ "@baloise/ds-maps": "19.9.4",
57
+ "@baloise/ds-brand-icons": "19.9.4",
58
+ "@baloise/ds-favicons": "19.9.4",
59
59
  "compression": "~1.8.1",
60
60
  "express": "~4.22.1",
61
61
  "serve-index": "~1.9.1"
@@ -1 +0,0 @@
1
- System.register(["./p-DUpGQx_U.system.js"],(function(t){"use strict";var n;return{setters:[function(t){n=t.a}],execute:function(){t("L",u);function u(){return function(t,u,e){var i=t.connectedCallback,r=t.disconnectedCallback;t.connectedCallback=function(){n.attach(this);return i&&i.call(this)};t.disconnectedCallback=function(){n.detach(this);return r&&r.call(this)}}}}}}));
@@ -1 +0,0 @@
1
- var __extends=this&&this.__extends||function(){var t=function(n,i){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))t[i]=n[i]};return t(n,i)};return function(n,i){if(typeof i!=="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(n,i);function s(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)}}();System.register(["./p-DUpGQx_U.system.js","./p-DDPYMMGG.system.js","./p-D7_eHNTI.system.js"],(function(t){"use strict";var n,i,s;return{setters:[function(t){n=t.B},function(t){i=t.a},function(t){s=t.b}],execute:function(){t("L",r);var e=function(t){__extends(i,t);function i(){var i=t.call(this,(function(t,n){t.windowResizeListener()}))||this;i.listener=new n;return i}i.prototype.attach=function(n){var i=this;t.prototype.attach.call(this,n);if(s.hasWindow){this.listener.connect(window);this.listener.add((function(){return t.prototype.notify.call(i)}))}};i.prototype.detach=function(){t.prototype.detach.call(this);this.listener.disconnect()};return i}(i);new e;function r(){return function(t,n,i){var s=t.connectedCallback,r=t.disconnectedCallback;t.connectedCallback=function(){if(!this._balWindowResizeSubject){this._balWindowResizeSubject=new e;this._balWindowResizeSubject.attach(this)}return s&&s.call(this)};t.disconnectedCallback=function(){if(this._balWindowResizeSubject){this._balWindowResizeSubject.detach();this._balWindowResizeSubject=undefined}return r&&r.call(this)}}}}}}));
@@ -1 +0,0 @@
1
- import{b as s}from"./p-MBsgW7uz.js";import{L as t,a as i}from"./p-C20cwFWy.js";import{l as e}from"./p-Ba5qjFjW.js";class h extends t{async connect(s){super.connect(s),await this.loadLib(),this.PointerListenerLib&&(this.pointerListener=new this.PointerListenerLib(s,{handleTouchEvents:!1}),this.pointerListener.on("swipeleft",(()=>this.notify({left:!0,right:!1}))),this.pointerListener.on("swiperight",(()=>this.notify({left:!1,right:!0}))))}disconnect(){var s;super.disconnect(),null===(s=this.pointerListener)||void 0===s||s.destroy()}async loadLib(){return new Promise(((s,t)=>{e((async()=>{import("./p-BkEdlCZJ.js").then((t=>{this.PointerListenerLib=t.PointerListener,s()})).catch(t)}))}))}}class r extends i{constructor(s={mobileOnly:!1}){super(((s,t)=>{t&&s.swipeListener(t)})),this.options=s,this.listener=new h}attach(t){(!0===this.options.mobileOnly&&s.isMobile||!0!==this.options.mobileOnly)&&(super.attach(t),this.listener.connect(t.el),this.listener.add((s=>super.notify(s))))}detach(){super.detach(),this.listener.disconnect()}}export{r as B}
@@ -1 +0,0 @@
1
- import{a as n}from"./p-DlPc3plk.js";function t(){return function(t){const{connectedCallback:c,disconnectedCallback:i}=t;t.connectedCallback=function(){return n.attach(this),c&&c.call(this)},t.disconnectedCallback=function(){return n.detach(this),i&&i.call(this)}}}export{t as L}
@@ -1 +0,0 @@
1
- import{h as i,r as s,c as t,H as e,g as a}from"./p-BdVwMG9u.js";import{_ as l,a as h}from"./p-dfXERft2.js";import{a as o}from"./p-DBsOHTWj.js";import{a as r}from"./p-BAaDJIzy.js";import{d as n}from"./p-FCLKfv6B.js";import{s as d,i as b,a as c,b as p,c as u,d as f}from"./p-CpDHeXfo.js";import{L as m}from"./p-D7ovid3w.js";import{g}from"./p-BFTU3MAI.js";import{B as v}from"./p-ByiN-QjD.js";import{F as j}from"./p-rBUN7c88.js";import"./p-xbSOW78W.js";import"./p-BnVL_HEz.js";import"./p-Ba5qjFjW.js";import"./p-B1u-Mq75.js";import"./p-D7M-7v58.js";var y,F,k={},B={},C=g(function(){if(F)return k;F=1,Object.defineProperty(k,"__esModule",{value:!0});var i=(y||(y=1,Object.defineProperty(B,"__esModule",{value:!0}),B.SPECS={si:{radix:1e3,unit:["b","kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"]},iec:{radix:1024,unit:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"]},jedec:{radix:1024,unit:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"]}}),B);return k.default=function(s,t,e){void 0===t&&(t=1),s=Math.abs(s);for(var a=i.SPECS[e]||i.SPECS.jedec,l=a.radix,h=a.unit,o=0;s>=l;)s/=l,++o;return s.toFixed(t)+" "+h[o]},k}());const _=v.block("file-upload").element("list"),M=({files:s,disabled:t,subTitle:e,onRemoveFile:a})=>i("bal-card",{class:Object.assign({},_.class()),flat:!0},i("bal-list",{disabled:t,border:!0,size:"large"},s.map(((s,l)=>i("bal-list-item",{key:s.name,disabled:t},i("bal-list-item-icon",null,i("bal-icon",{name:"document"})),i("bal-list-item-content",null,i("bal-list-item-title",null,s.name),i("bal-list-item-subtitle",null,e?e(s):C(s.size))),i("bal-list-item-icon",{right:!0,class:{"file-remove":!0}},i("button",{class:"button is-square is-danger",disabled:t,onClick:i=>a(i,l)},i("bal-icon",{name:"trash",color:t?"grey":"danger"})))))))),T=i=>{const s=new DataTransfer;return i&&i.length>0&&i.forEach((i=>s.items.add(i))),s.files},w=class{constructor(i){s(this,i),this.balChange=t(this,"balChange"),this.balFilesAdded=t(this,"balFilesAdded"),this.balFilesRemoved=t(this,"balFilesRemoved"),this.balRejectedFile=t(this,"balRejectedFile"),this.balInputClick=t(this,"balInputClick"),this.balBlur=t(this,"balBlur"),this.balFocus=t(this,"balFocus"),this.fileUploadId="bal-file-upload-"+x++,this.files=[],this.focused=!1,this.ariaForm=n,this.name=this.fileUploadId,this.value=[],this.initialValue=this.value||[],this.label="Choose or drop a file...",this.multiple=!0,this.disabled=!1,this.readonly=!1,this.loading=!1,this.required=!1,this.hasFileList=!0,this.invalid=!1,this.autoInvalidOff=!1,this.addEventListenerDragAndDrop=()=>{this.labelEl&&(this.labelEl.addEventListener("dragenter",this.onDragenter,!1),this.labelEl.addEventListener("dragover",this.onDragover,!1),this.labelEl.addEventListener("drop",this.onDrop,!1))},this.removeEventListenerDragAndDrop=()=>{this.labelEl&&(this.labelEl.removeEventListener("dragenter",this.onDragenter,!1),this.labelEl.removeEventListener("dragover",this.onDragover,!1),this.labelEl.removeEventListener("drop",this.onDrop,!1))},this.handleFiles=i=>{const s=Array.from(i||[]),t=((i,s,t)=>{const e=[],a=[...i],l=[];for(let h=0;h<s.length;h++){const o=s[h];if(o){const s=[];t.accept&&-1===t.accept.split(" ").join("").split(",").indexOf(o.type)&&s.push(j.BAD_EXTENSION),void 0!==t.maxFileSize&&o.size>t.maxFileSize&&s.push(j.FILE_TOO_BIG);const h=a.map((i=>i.size)).reduce(((i,s)=>i+s),0);void 0!==t.maxBundleSize&&h+o.size>t.maxBundleSize&&s.push(j.FILE_SIZE_SUM_TOO_BIG),void 0!==t.maxFiles&&a.length+1>t.maxFiles&&s.push(j.TOO_MANY_FILES);const r=(i,s)=>i.size===s.size&&i.name===s.name&&i.type===s.type&&i.lastModified===s.lastModified;i.filter((i=>r(i,o))).length>0&&s.push(j.DUPLICATED_FILE),s.length>0?l.push({file:o,reasons:s}):(a.push(o),e.push(o))}}return{validFiles:e,invalidFiles:l}})(this.files,s,{accept:this.accept,maxFileSize:this.maxFileSize,maxBundleSize:this.maxBundleSize,maxFiles:this.maxFiles});t.invalidFiles.length>0&&this.balRejectedFile.emit(t.invalidFiles[0]),t.validFiles.length>0&&(this.files=[...this.files,...t.validFiles],this.balChange.emit(this.files),this.balFilesAdded.emit(t.validFiles)),this.updateFileInput()},this.updateFileInput=()=>{var i;(null===(i=this.nativeInput)||void 0===i?void 0:i.files)&&(this.nativeInput.files=T(this.files))},this.onDragenter=i=>{d(i)},this.onDragover=i=>{d(i)},this.onDrop=i=>{if(d(i),!this.disabled&&!this.readonly&&!this.loading){const s=i.dataTransfer;s&&this.handleFiles(s.files)}},this.onInputChange=()=>{var i;this.disabled||this.readonly||this.loading||(null===(i=this.nativeInput)||void 0===i?void 0:i.files)&&this.handleFiles(this.nativeInput.files)},this.onRemoveFile=(i,s)=>{if(d(i),s>=0&&s<this.files.length){const i=this.files,t=i.splice(s,1);this.balFilesRemoved.emit(t),this.files=[...i],this.balChange.emit(this.files),this.updateFileInput()}},this.onHostClick=i=>b(this,i),this.onInputFocus=i=>c(this,i),this.onInputBlur=i=>p(this,i),this.onInputClick=i=>{!this.nativeInput||this.disabled||this.readonly||this.loading||(this.nativeInput.value=""),this.balInputClick.emit(i)}}createLogger(i){this.log=i}onValueChange(){r(this.files,this.value)||(this.files=this.value)}componentWillLoad(){this.onValueChange()}connectedCallback(){this.initialValue=this.value||[],this.addEventListenerDragAndDrop()}componentDidLoad(){this.addEventListenerDragAndDrop()}disconnectedCallback(){this.removeEventListenerDragAndDrop()}resetHandler(i){const s=i.target;(null==s?void 0:s.contains(this.el))&&(this.files=[...this.initialValue],clearTimeout(this.resetHandlerTimer),this.resetHandlerTimer=setTimeout((()=>{this.nativeInput&&(this.nativeInput.files=T(this.initialValue))})))}async clear(){this.files=[],this.updateFileInput()}async setFocus(){u(this)}async setBlur(){f(this)}getInputElement(){return Promise.resolve(this.nativeInput)}async setAriaForm(i){this.ariaForm=Object.assign({},i)}render(){const s=this.ariaForm.controlId||this.fileUploadId;return i(e,{key:"05b754f351fce01410a7b962aac9df747a2199ff",onClick:this.onHostClick,"aria-disabled":o(this.disabled),class:{"bal-file-upload":!0}},i("div",{key:"9e2f871f72b1c666ed8d911e91cfedaf548c2519",class:{file:!0,"is-disabled":this.disabled||this.readonly||this.loading,"is-danger":this.invalid}},i("label",{key:"9976fcf5ba8dd68ff8d01bf0c963a0feee42fd21",htmlFor:s,ref:i=>this.labelEl=i,class:{"file-label":!0,"is-disabled":this.disabled||this.loading||this.readonly}},i("input",{key:"7596fa2c3174ac804b3b3b950c6e181a25080d80",class:"file-input",type:"file",id:s,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":!0===this.invalid?"true":"false","aria-disabled":o(this.disabled),name:this.name,multiple:this.multiple,disabled:this.disabled||this.loading||this.readonly,readonly:this.readonly,required:this.required,accept:this.accept,onClick:this.onInputClick,onChange:this.onInputChange,onFocus:this.onInputFocus,onBlur:this.onInputBlur,ref:i=>this.nativeInput=i,"data-testid":"bal-file-upload-input"}),this.loading?i("span",{class:"file-cta"},i("bal-spinner",null)):i("span",{class:"file-cta"},i("span",{class:"file-icon"},i("bal-icon",{name:"upload",size:"medium",color:this.disabled||this.loading||this.readonly?"grey-light":this.invalid?"danger":"blue"})),i("span",{class:"file-label","data-testid":"bal-file-upload-label"},this.label)))),this.hasFileList&&this.files.length>0?i(M,{files:this.files,disabled:this.disabled||this.readonly||this.loading,subTitle:this.subTitle,onRemoveFile:this.onRemoveFile}):"")}get el(){return a(this)}static get watchers(){return{value:["onValueChange"]}}};l([m("bal-file-upload"),h("design:type",Function),h("design:paramtypes",[Function]),h("design:returntype",void 0)],w.prototype,"createLogger",null);let x=0;w.style=".bal-file-upload{display:block;position:static;width:100%}.bal-file-upload .file-label{word-break:break-word;white-space:normal}.bal-file-upload .bal-heading{word-break:break-all}.bal-file-upload__card{margin-top:var(--bal-space-normal)}.bal-file-upload__list{padding:0 !important}";export{w as bal_file_upload}
@@ -1 +0,0 @@
1
- import{__awaiter,__extends,__generator}from"tslib";import{b as balDevice}from"./device-TtMibDFL.js";import{L as ListenerAbstract,a as SingleSubject}from"./listener-CClDIhvK.js";import{l as rOnLoad}from"./helpers-BNj87EbG.js";var BalSwipeListener=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}i.prototype.connect=function(i){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(n){switch(n.label){case 0:t.prototype.connect.call(this,i);return[4,this.loadLib()];case 1:n.sent();if(this.PointerListenerLib){this.pointerListener=new this.PointerListenerLib(i,{handleTouchEvents:false});this.pointerListener.on("swipeleft",(function(){return e.notify({left:true,right:false})}));this.pointerListener.on("swiperight",(function(){return e.notify({left:false,right:true})}))}return[2]}}))}))};i.prototype.disconnect=function(){var i;t.prototype.disconnect.call(this);(i=this.pointerListener)===null||i===void 0?void 0:i.destroy()};i.prototype.loadLib=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){return[2,new Promise((function(i,e){rOnLoad((function(){return __awaiter(t,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){import("./contact-BkEdlCZJ.js").then((function(e){t.PointerListenerLib=e.PointerListener;i()})).catch(e);return[2]}))}))}))}))]}))}))};return i}(ListenerAbstract);var BalSwipeSubject=function(t){__extends(i,t);function i(i){if(i===void 0){i={mobileOnly:false}}var e=t.call(this,(function(t,i){if(i){t.swipeListener(i)}}))||this;e.options=i;e.listener=new BalSwipeListener;return e}i.prototype.attach=function(i){var e=this;if(this.options.mobileOnly===true&&balDevice.isMobile||this.options.mobileOnly!==true){t.prototype.attach.call(this,i);this.listener.connect(i.el);this.listener.add((function(i){return t.prototype.notify.call(e,i)}))}};i.prototype.detach=function(){t.prototype.detach.call(this);this.listener.disconnect()};return i}(SingleSubject);export{BalSwipeSubject as B};