@kyndryl-design-system/shidoka-applications 2.30.0 → 2.31.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 (94) hide show
  1. package/common/helpers/swiper.js +1 -1
  2. package/components/ai/sourcesFeedback/aiSourcesFeedback.js +1 -1
  3. package/components/ai/sourcesFeedback/index.js +1 -1
  4. package/components/global/header/headerFlyout.js +1 -1
  5. package/components/global/header/headerFlyouts.js +1 -1
  6. package/components/global/header/headerLink.js +1 -1
  7. package/components/global/header/headerNav.js +1 -1
  8. package/components/global/header/index.js +1 -1
  9. package/components/global/localNav/index.js +1 -1
  10. package/components/global/localNav/localNav.js +1 -1
  11. package/components/global/localNav/localNavLink.js +1 -1
  12. package/components/reusable/accordion/accordionItem.js +1 -1
  13. package/components/reusable/accordion/index.js +1 -1
  14. package/components/reusable/badge/badge.js +1 -1
  15. package/components/reusable/badge/index.js +1 -1
  16. package/components/reusable/blockCodeView/blockCodeView.js +1 -1
  17. package/components/reusable/blockCodeView/index.js +1 -1
  18. package/components/reusable/checkbox/checkboxGroup.js +1 -1
  19. package/components/reusable/checkbox/index.js +1 -1
  20. package/components/reusable/datePicker/datepicker.js +1 -1
  21. package/components/reusable/datePicker/index.js +1 -1
  22. package/components/reusable/daterangepicker/daterangepicker.js +1 -1
  23. package/components/reusable/daterangepicker/index.js +1 -1
  24. package/components/reusable/dropdown/dropdown.js +1 -1
  25. package/components/reusable/dropdown/dropdownOption.js +1 -1
  26. package/components/reusable/dropdown/index.js +1 -1
  27. package/components/reusable/fileUploader/fileUploader.d.ts.map +1 -1
  28. package/components/reusable/fileUploader/fileUploader.js +14 -9
  29. package/components/reusable/fileUploader/fileUploader.js.map +1 -1
  30. package/components/reusable/fileUploader/fileUploaderListContainer.js +8 -5
  31. package/components/reusable/fileUploader/fileUploaderListContainer.js.map +1 -1
  32. package/components/reusable/fileUploader/index.js +1 -1
  33. package/components/reusable/inlineConfirm/index.js +1 -1
  34. package/components/reusable/inlineConfirm/inlineConfirm.js +1 -1
  35. package/components/reusable/loaders/index.js +1 -1
  36. package/components/reusable/loaders/inline.js +1 -1
  37. package/components/reusable/modal/index.js +1 -1
  38. package/components/reusable/modal/modal.js +1 -1
  39. package/components/reusable/notification/index.js +1 -1
  40. package/components/reusable/notification/notification.js +1 -1
  41. package/components/reusable/numberInput/index.js +1 -1
  42. package/components/reusable/numberInput/numberInput.js +1 -1
  43. package/components/reusable/overflowMenu/index.js +1 -1
  44. package/components/reusable/overflowMenu/overflowMenu.js +1 -1
  45. package/components/reusable/overflowMenu/overflowMenuItem.js +1 -1
  46. package/components/reusable/pagination/Pagination.js +1 -1
  47. package/components/reusable/pagination/index.js +1 -1
  48. package/components/reusable/pagination/pagination-navigation-buttons.js +1 -1
  49. package/components/reusable/pagination/pagination-page-size-dropdown.js +1 -1
  50. package/components/reusable/progressBar/index.js +1 -1
  51. package/components/reusable/progressBar/progressBar.js +1 -1
  52. package/components/reusable/radioButton/index.js +1 -1
  53. package/components/reusable/radioButton/radioButtonGroup.js +1 -1
  54. package/components/reusable/search/index.js +1 -1
  55. package/components/reusable/search/search.js +1 -1
  56. package/components/reusable/sideDrawer/index.js +1 -1
  57. package/components/reusable/sideDrawer/sideDrawer.js +1 -1
  58. package/components/reusable/sliderInput/index.js +1 -1
  59. package/components/reusable/sliderInput/sliderInput.js +1 -1
  60. package/components/reusable/splitButton/index.js +1 -1
  61. package/components/reusable/splitButton/splitButton.js +1 -1
  62. package/components/reusable/stepper/index.js +1 -1
  63. package/components/reusable/stepper/stepper.js +1 -1
  64. package/components/reusable/stepper/stepperItem.js +1 -1
  65. package/components/reusable/table/index.js +1 -1
  66. package/components/reusable/table/table-body.js +1 -1
  67. package/components/reusable/table/table-header-row.js +1 -1
  68. package/components/reusable/table/table-header.js +1 -1
  69. package/components/reusable/table/table-row.js +1 -1
  70. package/components/reusable/table/table.skeleton.js +1 -1
  71. package/components/reusable/tag/index.js +1 -1
  72. package/components/reusable/tag/tag.d.ts +8 -2
  73. package/components/reusable/tag/tag.d.ts.map +1 -1
  74. package/components/reusable/tag/tag.js +11 -10
  75. package/components/reusable/tag/tag.js.map +1 -1
  76. package/components/reusable/tag/tag.skeleton.js +1 -1
  77. package/components/reusable/tag/tagGroup.js +1 -1
  78. package/components/reusable/textArea/index.js +1 -1
  79. package/components/reusable/textArea/textArea.js +1 -1
  80. package/components/reusable/textInput/index.js +1 -1
  81. package/components/reusable/textInput/textInput.js +1 -1
  82. package/components/reusable/timepicker/index.js +1 -1
  83. package/components/reusable/timepicker/timepicker.js +1 -1
  84. package/components/reusable/tooltip/index.js +1 -1
  85. package/components/reusable/tooltip/tooltip.js +1 -1
  86. package/components/reusable/widget/index.js +1 -1
  87. package/components/reusable/widget/widgetDragHandle.js +1 -1
  88. package/index.js +1 -1
  89. package/package.json +2 -2
  90. package/{tag-f3175688.js → tag-f2565c2b.js} +233 -28
  91. package/{tag-f3175688.js.map → tag-f2565c2b.js.map} +1 -1
  92. package/vendor/@kyndryl-design-system/{shidoka-icons-3b793be1.js → shidoka-icons-24ba60f3.js} +2 -2
  93. package/vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js.map +1 -0
  94. package/vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{a as e}from"../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";const n={slidesPerView:1.25,centeredSlides:!0,spaceBetween:16,breakpoints:{672:{slidesPerView:"auto",spaceBetween:24}},keyboard:{enabled:!0},mousewheel:{enabled:!0,forceToAxis:!0},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},scrollbar:{el:".swiper-scrollbar",draggable:!0},pagination:{el:".swiper-pagination",clickable:!0,type:"fraction"},on:{init:function(n){n.navigation.prevEl.innerHTML=e,n.navigation.nextEl.innerHTML=e,t(n)},transitionEnd:function(e){t(e)},scrollbarDragEnd:function(e){t(e)}}},t=e=>{const n=e.el.getBoundingClientRect();e.slides.forEach((e=>{const t=e.getBoundingClientRect();t.left<n.left||t.right>n.width+n.left?(e.classList.add("off-screen"),e.setAttribute("aria-disabled","true")):(e.classList.remove("off-screen"),e.setAttribute("aria-disabled","false"))}))};export{n as SwiperConfig};
1
+ import{a as e}from"../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";const n={slidesPerView:1.25,centeredSlides:!0,spaceBetween:16,breakpoints:{672:{slidesPerView:"auto",spaceBetween:24}},keyboard:{enabled:!0},mousewheel:{enabled:!0,forceToAxis:!0},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},scrollbar:{el:".swiper-scrollbar",draggable:!0},pagination:{el:".swiper-pagination",clickable:!0,type:"fraction"},on:{init:function(n){n.navigation.prevEl.innerHTML=e,n.navigation.nextEl.innerHTML=e,t(n)},transitionEnd:function(e){t(e)},scrollbarDragEnd:function(e){t(e)}}},t=e=>{const n=e.el.getBoundingClientRect();e.slides.forEach((e=>{const t=e.getBoundingClientRect();t.left<n.left||t.right>n.width+n.left?(e.classList.add("off-screen"),e.setAttribute("aria-disabled","true")):(e.classList.remove("off-screen"),e.setAttribute("aria-disabled","false"))}))};export{n as SwiperConfig};
2
2
  //# sourceMappingURL=swiper.js.map
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{n as t,t as s,l as i,c as o,e as n}from"../../../vendor/lit-461e78e6.js";import{i as a,s as d,x as l}from"../../../vendor/lit-element-c6c02f24.js";import{d as r}from"../../../vendor/deepmerge-ts-e62363e6.js";import{e as c}from"../../../vendor/lit-html-29220869.js";import{f as p,D as b,E as h,F as k,G as u,c as m}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../../reusable/link/link.js";import"../../reusable/card/card.js";import"../../reusable/card/vitalCard.skeleton.js";import"../../reusable/card/informationalCard.skeleton.js";import"../../reusable/button/button.js";import"../../reusable/link/defs.js";import"../../reusable/loaders/skeleton.js";import"../../../cardSample-37bc81e6.js";import"../../../common/helpers/helpers.js";import"../../reusable/button/defs.js";var v=a`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{n as t,t as s,l as i,c as o,e as n}from"../../../vendor/lit-461e78e6.js";import{i as a,s as d,x as l}from"../../../vendor/lit-element-c6c02f24.js";import{d as r}from"../../../vendor/deepmerge-ts-e62363e6.js";import{e as c}from"../../../vendor/lit-html-29220869.js";import{f as p,D as b,E as h,F as k,G as u,c as m}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../../reusable/link/link.js";import"../../reusable/card/card.js";import"../../reusable/card/vitalCard.skeleton.js";import"../../reusable/card/informationalCard.skeleton.js";import"../../reusable/button/button.js";import"../../reusable/link/defs.js";import"../../reusable/loaders/skeleton.js";import"../../../cardSample-37bc81e6.js";import"../../../common/helpers/helpers.js";import"../../reusable/button/defs.js";var v=a`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,2 +1,2 @@
1
- export{AISourcesFeedback}from"./aiSourcesFeedback.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../../reusable/link/link.js";import"../../reusable/link/defs.js";import"../../reusable/card/card.js";import"../../reusable/card/vitalCard.skeleton.js";import"../../reusable/loaders/skeleton.js";import"../../../cardSample-37bc81e6.js";import"../../reusable/card/informationalCard.skeleton.js";import"../../reusable/button/button.js";import"../../../common/helpers/helpers.js";import"../../reusable/button/defs.js";
1
+ export{AISourcesFeedback}from"./aiSourcesFeedback.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../../reusable/link/link.js";import"../../reusable/link/defs.js";import"../../reusable/card/card.js";import"../../reusable/card/vitalCard.skeleton.js";import"../../reusable/loaders/skeleton.js";import"../../../cardSample-37bc81e6.js";import"../../reusable/card/informationalCard.skeleton.js";import"../../reusable/button/button.js";import"../../../common/helpers/helpers.js";import"../../reusable/button/defs.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import{_ as t}from"../../../vendor/tslib-53a81efe.js";import{o as e}from"../../../vendor/lit-html-29220869.js";import{n as i,l as o,o as n,e as r}from"../../../vendor/lit-461e78e6.js";import{i as a,s as l,x as s}from"../../../vendor/lit-element-c6c02f24.js";import{b as d,d as c}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";var h=a`*,
1
+ import{_ as t}from"../../../vendor/tslib-53a81efe.js";import{o as e}from"../../../vendor/lit-html-29220869.js";import{n as i,l as o,o as n,e as r}from"../../../vendor/lit-461e78e6.js";import{i as a,s as l,x as s}from"../../../vendor/lit-element-c6c02f24.js";import{b as d,d as c}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";var h=a`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as o,e as i}from"../../../vendor/lit-461e78e6.js";import{i as r,s as n,x as a}from"../../../vendor/lit-element-c6c02f24.js";import{o as d}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";var l=r`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as o,e as i}from"../../../vendor/lit-461e78e6.js";import{i as r,s as n,x as a}from"../../../vendor/lit-element-c6c02f24.js";import{o as d}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";var l=r`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as i,t as o,l as n,o as r,e as a}from"../../../vendor/lit-461e78e6.js";import{i as l,s,x as d}from"../../../vendor/lit-element-c6c02f24.js";import{debounce as c}from"../../../common/helpers/helpers.js";import"../../reusable/textInput/textInput.js";import{b as h,d as v,s as m}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../reusable/button/button.js";import"../../reusable/button/defs.js";import"../../../common/mixins/form-input.js";var p=l`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as i,t as o,l as n,o as r,e as a}from"../../../vendor/lit-461e78e6.js";import{i as l,s,x as d}from"../../../vendor/lit-element-c6c02f24.js";import{debounce as c}from"../../../common/helpers/helpers.js";import"../../reusable/textInput/textInput.js";import{b as h,d as v,s as m}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../reusable/button/button.js";import"../../reusable/button/defs.js";import"../../../common/mixins/form-input.js";var p=l`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{t as o,n as i,o as n,e as r}from"../../../vendor/lit-461e78e6.js";import{i as a,s as d,x as l}from"../../../vendor/lit-element-c6c02f24.js";import{e as s,m as c}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";var u=a`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{t as o,n as i,o as n,e as r}from"../../../vendor/lit-461e78e6.js";import{i as a,s as d,x as l}from"../../../vendor/lit-element-c6c02f24.js";import{e as s,m as c}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";var u=a`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,2 +1,2 @@
1
- export{Header}from"./header.js";export{HeaderNav}from"./headerNav.js";export{HeaderLink}from"./headerLink.js";export{HeaderCategory}from"./headerCategory.js";export{HeaderDivider}from"./headerDivider.js";export{HeaderFlyouts}from"./headerFlyouts.js";export{HeaderFlyout}from"./headerFlyout.js";export{HeaderUserProfile}from"./headerUserProfile.js";export{HeaderPanelLink}from"./headerPanelLink.js";export{HeaderNotificationPanel}from"./headerNotificationPanel.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/@kyndryl-design-system/shidoka-foundation-2d7bab68.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../../../common/helpers/helpers.js";import"../../reusable/textInput/textInput.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../reusable/button/button.js";import"../../reusable/button/defs.js";import"../../../common/mixins/form-input.js";import"../../reusable/link/link.js";import"../../reusable/link/defs.js";
1
+ export{Header}from"./header.js";export{HeaderNav}from"./headerNav.js";export{HeaderLink}from"./headerLink.js";export{HeaderCategory}from"./headerCategory.js";export{HeaderDivider}from"./headerDivider.js";export{HeaderFlyouts}from"./headerFlyouts.js";export{HeaderFlyout}from"./headerFlyout.js";export{HeaderUserProfile}from"./headerUserProfile.js";export{HeaderPanelLink}from"./headerPanelLink.js";export{HeaderNotificationPanel}from"./headerNotificationPanel.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/@kyndryl-design-system/shidoka-foundation-2d7bab68.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../../../common/helpers/helpers.js";import"../../reusable/textInput/textInput.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../reusable/button/button.js";import"../../reusable/button/defs.js";import"../../../common/mixins/form-input.js";import"../../reusable/link/link.js";import"../../reusable/link/defs.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{LocalNav}from"./localNav.js";export{LocalNavLink}from"./localNavLink.js";export{LocalNavDivider}from"./localNavDivider.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../reusable/button/button.js";import"../../../common/helpers/helpers.js";import"../../reusable/button/defs.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";
1
+ export{LocalNav}from"./localNav.js";export{LocalNavLink}from"./localNavLink.js";export{LocalNavDivider}from"./localNavDivider.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../reusable/button/button.js";import"../../../common/helpers/helpers.js";import"../../reusable/button/defs.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as i}from"../../../vendor/lit-html-29220869.js";import{n as t,t as n,l as o,o as a,e as d}from"../../../vendor/lit-461e78e6.js";import{i as r,s,x as l}from"../../../vendor/lit-element-c6c02f24.js";import{d as p}from"../../../vendor/deepmerge-ts-e62363e6.js";import"../../reusable/button/button.js";import{f as h,p as c}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../../../common/helpers/helpers.js";import"../../reusable/button/defs.js";var m=r`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as i}from"../../../vendor/lit-html-29220869.js";import{n as t,t as n,l as o,o as a,e as d}from"../../../vendor/lit-461e78e6.js";import{i as r,s,x as l}from"../../../vendor/lit-element-c6c02f24.js";import{d as p}from"../../../vendor/deepmerge-ts-e62363e6.js";import"../../reusable/button/button.js";import{f as h,p as c}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../../../common/helpers/helpers.js";import"../../reusable/button/defs.js";var m=r`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as i,t as n,l as o,o as a,e as d}from"../../../vendor/lit-461e78e6.js";import{i as l,s as r,x as s}from"../../../vendor/lit-element-c6c02f24.js";import{f as p,d as h}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";var c=l`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as i,t as n,l as o,o as a,e as d}from"../../../vendor/lit-461e78e6.js";import{i as l,s as r,x as s}from"../../../vendor/lit-element-c6c02f24.js";import{f as p,d as h}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";var c=l`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{n as i,t,c as o,e as n}from"../../../vendor/lit-461e78e6.js";import{i as r,s as d,x as l}from"../../../vendor/lit-element-c6c02f24.js";import{e as a}from"../../../vendor/lit-html-29220869.js";import{C as s}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";var c=r`/**
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{n as i,t,c as o,e as n}from"../../../vendor/lit-461e78e6.js";import{i as r,s as d,x as l}from"../../../vendor/lit-element-c6c02f24.js";import{e as a}from"../../../vendor/lit-html-29220869.js";import{C as s}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";var c=r`/**
2
2
  * Copyright Kyndryl, Inc. 2023
3
3
  */
4
4
  *,
@@ -1,2 +1,2 @@
1
- export{Accordion}from"./accordion.js";export{AccordionItem}from"./accordionItem.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";
1
+ export{Accordion}from"./accordion.js";export{AccordionItem}from"./accordionItem.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import{_ as r}from"../../../vendor/tslib-53a81efe.js";import{n as o,t as e,c as a,e as i}from"../../../vendor/lit-461e78e6.js";import{i as t,s as d,x as l}from"../../../vendor/lit-element-c6c02f24.js";import{e as c}from"../../../vendor/lit-html-29220869.js";import{H as n,I as g,J as s,K as b,L as m}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";var u=t`*,
1
+ import{_ as r}from"../../../vendor/tslib-53a81efe.js";import{n as o,t as e,c as a,e as i}from"../../../vendor/lit-461e78e6.js";import{i as t,s as d,x as l}from"../../../vendor/lit-element-c6c02f24.js";import{e as c}from"../../../vendor/lit-html-29220869.js";import{H as n,I as g,J as s,K as b,L as m}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";var u=t`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,2 +1,2 @@
1
- export{Badge}from"./badge.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";
1
+ export{Badge}from"./badge.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as o,t as i,b as n,o as a,e as r}from"../../../vendor/lit-461e78e6.js";import{i as s,s as l,x as d}from"../../../vendor/lit-element-c6c02f24.js";import{d as c}from"../../../vendor/deepmerge-ts-e62363e6.js";import{P as p}from"../../../vendor/prismjs-860c2ccc.js";import{M as h,N as g,f as m}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../button/button.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";var u=s`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as o,t as i,b as n,o as a,e as r}from"../../../vendor/lit-461e78e6.js";import{i as s,s as l,x as d}from"../../../vendor/lit-element-c6c02f24.js";import{d as c}from"../../../vendor/deepmerge-ts-e62363e6.js";import{P as p}from"../../../vendor/prismjs-860c2ccc.js";import{M as h,N as g,f as m}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../button/button.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";var u=s`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,2 +1,2 @@
1
- export{BlockCodeView}from"./blockCodeView.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../../vendor/prismjs-860c2ccc.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";
1
+ export{BlockCodeView}from"./blockCodeView.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../../vendor/prismjs-860c2ccc.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as i,t as l,e as o}from"../../../vendor/lit-461e78e6.js";import{i as r,x as a,s}from"../../../vendor/lit-element-c6c02f24.js";import{d as n}from"../../../vendor/deepmerge-ts-e62363e6.js";import{FormMixin as d}from"../../../common/mixins/form-input.js";import"../textInput/textInput.js";import"./checkbox.js";import{g as c}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";var h=r`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as i,t as l,e as o}from"../../../vendor/lit-461e78e6.js";import{i as r,x as a,s}from"../../../vendor/lit-element-c6c02f24.js";import{d as n}from"../../../vendor/deepmerge-ts-e62363e6.js";import{FormMixin as d}from"../../../common/mixins/form-input.js";import"../textInput/textInput.js";import"./checkbox.js";import{g as c}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";var h=r`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,2 +1,2 @@
1
- export{Checkbox}from"./checkbox.js";export{CheckboxGroup}from"./checkboxGroup.js";export{CheckboxSubgroup}from"./checkboxSubgroup.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../../common/mixins/form-input.js";import"../textInput/textInput.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";
1
+ export{Checkbox}from"./checkbox.js";export{CheckboxGroup}from"./checkboxGroup.js";export{CheckboxSubgroup}from"./checkboxSubgroup.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../../common/mixins/form-input.js";import"../textInput/textInput.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import{_ as t}from"../../../vendor/tslib-53a81efe.js";import{o as e,n as i,t as a,i as r,e as l}from"../../../vendor/lit-461e78e6.js";import{i as n,x as s,s as o}from"../../../vendor/lit-element-c6c02f24.js";import{FormMixin as d}from"../../../common/mixins/form-input.js";import{o as p}from"../../../vendor/lit-html-29220869.js";import{getPlaceholder as c,injectFlatpickrStyles as h,updateEnableTime as u,emitValue as m,initializeSingleAnchorFlatpickr as v,getModalContainer as f,setCalendarAttributes as k,hideEmptyYear as g,getFlatpickrOptions as b,loadLocale as y,preventFlatpickrOpen as x,handleInputClick as _,handleInputFocus as w}from"../../../common/helpers/flatpickr.js";import"../button/button.js";import{c as D}from"../../../shidoka-flatpickr-theme-469e3123.js";import{c as z,O as I,P as F}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../common/flatpickrLangs.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";var $=n`*,
1
+ import{_ as t}from"../../../vendor/tslib-53a81efe.js";import{o as e,n as i,t as a,i as r,e as l}from"../../../vendor/lit-461e78e6.js";import{i as n,x as s,s as o}from"../../../vendor/lit-element-c6c02f24.js";import{FormMixin as d}from"../../../common/mixins/form-input.js";import{o as p}from"../../../vendor/lit-html-29220869.js";import{getPlaceholder as c,injectFlatpickrStyles as h,updateEnableTime as u,emitValue as m,initializeSingleAnchorFlatpickr as v,getModalContainer as f,setCalendarAttributes as k,hideEmptyYear as g,getFlatpickrOptions as b,loadLocale as y,preventFlatpickrOpen as x,handleInputClick as _,handleInputFocus as w}from"../../../common/helpers/flatpickr.js";import"../button/button.js";import{c as D}from"../../../shidoka-flatpickr-theme-469e3123.js";import{c as z,O as I,P as F}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../common/flatpickrLangs.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";var $=n`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,2 +1,2 @@
1
- export{DatePicker}from"./datepicker.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../common/mixins/form-input.js";import"../../../vendor/lit-html-29220869.js";import"../../../common/helpers/flatpickr.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../common/flatpickrLangs.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../../../shidoka-flatpickr-theme-469e3123.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";
1
+ export{DatePicker}from"./datepicker.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../common/mixins/form-input.js";import"../../../vendor/lit-html-29220869.js";import"../../../common/helpers/flatpickr.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../common/flatpickrLangs.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../../../shidoka-flatpickr-theme-469e3123.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import{_ as t}from"../../../vendor/tslib-53a81efe.js";import{o as e,n as i,t as a,i as r,e as l}from"../../../vendor/lit-461e78e6.js";import{i as n,x as s,s as o}from"../../../vendor/lit-element-c6c02f24.js";import{FormMixin as d}from"../../../common/mixins/form-input.js";import{o as h}from"../../../vendor/lit-html-29220869.js";import{getPlaceholder as p,injectFlatpickrStyles as c,updateEnableTime as u,emitValue as v,initializeSingleAnchorFlatpickr as m,getModalContainer as g,setCalendarAttributes as f,hideEmptyYear as k,getFlatpickrOptions as b,loadLocale as y,preventFlatpickrOpen as x,handleInputClick as _,handleInputFocus as w}from"../../../common/helpers/flatpickr.js";import"../button/button.js";import{c as D}from"../../../shidoka-flatpickr-theme-469e3123.js";import{c as F,O as I,P as z}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../common/flatpickrLangs.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";var S=n`*,
1
+ import{_ as t}from"../../../vendor/tslib-53a81efe.js";import{o as e,n as i,t as a,i as r,e as l}from"../../../vendor/lit-461e78e6.js";import{i as n,x as s,s as o}from"../../../vendor/lit-element-c6c02f24.js";import{FormMixin as d}from"../../../common/mixins/form-input.js";import{o as h}from"../../../vendor/lit-html-29220869.js";import{getPlaceholder as p,injectFlatpickrStyles as c,updateEnableTime as u,emitValue as v,initializeSingleAnchorFlatpickr as m,getModalContainer as g,setCalendarAttributes as f,hideEmptyYear as k,getFlatpickrOptions as b,loadLocale as y,preventFlatpickrOpen as x,handleInputClick as _,handleInputFocus as w}from"../../../common/helpers/flatpickr.js";import"../button/button.js";import{c as D}from"../../../shidoka-flatpickr-theme-469e3123.js";import{c as F,O as I,P as z}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../common/flatpickrLangs.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";var S=n`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,2 +1,2 @@
1
- export{DateRangePicker}from"./daterangepicker.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../common/mixins/form-input.js";import"../../../vendor/lit-html-29220869.js";import"../../../common/helpers/flatpickr.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../common/flatpickrLangs.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../../../shidoka-flatpickr-theme-469e3123.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";
1
+ export{DateRangePicker}from"./daterangepicker.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../common/mixins/form-input.js";import"../../../vendor/lit-html-29220869.js";import"../../../common/helpers/flatpickr.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../../../common/flatpickrLangs.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../../../shidoka-flatpickr-theme-469e3123.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{o as i,n as l,t as o,l as a,i as s,e as r}from"../../../vendor/lit-461e78e6.js";import{i as n,x as d,s as h}from"../../../vendor/lit-element-c6c02f24.js";import{FormMixin as p}from"../../../common/mixins/form-input.js";import{d as c}from"../../../vendor/deepmerge-ts-e62363e6.js";import"./dropdownOption.js";import"../tag/tag.js";import"../tag/tagGroup.js";import"../tag/tag.skeleton.js";import"../button/button.js";import{e as u,f as m,g as v}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../checkbox/checkbox.js";import"../checkbox/checkboxGroup.js";import"../textInput/textInput.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../checkbox/checkboxSubgroup.js";import"../../../tag-f3175688.js";import"../link/link.js";import"../link/defs.js";import"../loaders/skeleton.js";var g=n`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{o as i,n as l,t as o,l as a,i as s,e as r}from"../../../vendor/lit-461e78e6.js";import{i as n,x as d,s as h}from"../../../vendor/lit-element-c6c02f24.js";import{FormMixin as p}from"../../../common/mixins/form-input.js";import{d as c}from"../../../vendor/deepmerge-ts-e62363e6.js";import"./dropdownOption.js";import"../tag/tag.js";import"../tag/tagGroup.js";import"../tag/tag.skeleton.js";import"../button/button.js";import{e as u,f as m,g as v}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../checkbox/checkbox.js";import"../checkbox/checkboxGroup.js";import"../textInput/textInput.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../checkbox/checkboxSubgroup.js";import"../../../tag-f2565c2b.js";import"../link/link.js";import"../link/defs.js";import"../loaders/skeleton.js";var g=n`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as o,t as i,e as l}from"../../../vendor/lit-461e78e6.js";import{i as s,s as d,x as r}from"../../../vendor/lit-element-c6c02f24.js";import"../checkbox/checkbox.js";import"../checkbox/checkboxGroup.js";import"../checkbox/checkboxSubgroup.js";import{h as n}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../../common/mixins/form-input.js";import"../textInput/textInput.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";var a=s`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{o as t}from"../../../vendor/lit-html-29220869.js";import{n as o,t as i,e as l}from"../../../vendor/lit-461e78e6.js";import{i as s,s as d,x as r}from"../../../vendor/lit-element-c6c02f24.js";import"../checkbox/checkbox.js";import"../checkbox/checkboxGroup.js";import"../checkbox/checkboxSubgroup.js";import{h as n}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../../../common/mixins/form-input.js";import"../textInput/textInput.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";var a=s`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -1,2 +1,2 @@
1
- export{Dropdown}from"./dropdown.js";export{DropdownOption}from"./dropdownOption.js";export{DropdownCategory}from"./dropdownCategory.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../common/mixins/form-input.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../tag/tag.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import"../../../tag-f3175688.js";import"../tag/tagGroup.js";import"../link/link.js";import"../link/defs.js";import"../tag/tag.skeleton.js";import"../loaders/skeleton.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../checkbox/checkbox.js";import"../checkbox/checkboxGroup.js";import"../textInput/textInput.js";import"../checkbox/checkboxSubgroup.js";
1
+ export{Dropdown}from"./dropdown.js";export{DropdownOption}from"./dropdownOption.js";export{DropdownCategory}from"./dropdownCategory.js";import"../../../vendor/tslib-53a81efe.js";import"../../../vendor/lit-html-29220869.js";import"../../../vendor/lit-461e78e6.js";import"../../../vendor/lit-element-c6c02f24.js";import"../../../common/mixins/form-input.js";import"../../../vendor/deepmerge-ts-e62363e6.js";import"../tag/tag.js";import"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import"../../../tag-f2565c2b.js";import"../tag/tagGroup.js";import"../link/link.js";import"../link/defs.js";import"../tag/tag.skeleton.js";import"../loaders/skeleton.js";import"../button/button.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../checkbox/checkbox.js";import"../checkbox/checkboxGroup.js";import"../textInput/textInput.js";import"../checkbox/checkboxSubgroup.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileUploader.d.ts","sourceRoot":"","sources":["../../../../src/components/reusable/fileUploader/fileUploader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAYvC,OAAO,6BAA6B,CAAC;AACrC,OAAO,WAAW,CAAC;AACnB,OAAO,YAAY,CAAC;AACpB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;;AAsBzB;;;;GAIG;AACH,qBACa,YAAa,SAAQ,iBAAqB;IACrD,OAAgB,MAAM,MAAoB;IAE1C;;;;;;;OAOG;IAEH,MAAM,EAAE,MAAM,EAAE,CAAM;IAEtB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,WAAW;;;;;;;;;;;;;;;;;;MAAuB;IAElC;;;;;;OAMG;IAEH,WAAW,SAAW;IAEtB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,IAAI,CAAC;QACX,MAAM,EAAE,KAAK,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;KACpD,EAAE,CAAM;IAET;;OAEG;IAEH,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI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AuBvB,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,oBAAoB;CAS7B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,YAAY,CAAC;KACnC;CACF"}
@@ -1,4 +1,4 @@
1
- import{_ as i}from"../../../vendor/tslib-53a81efe.js";import{o as e,c as t,n as l,t as a,i as n,e as o}from"../../../vendor/lit-461e78e6.js";import{i as r,x as s,s as d}from"../../../vendor/lit-element-c6c02f24.js";import{d as c}from"../../../vendor/deepmerge-ts-e62363e6.js";import{Q as p,R as h,S as f,T as m,U as g}from"../../../vendor/@kyndryl-design-system/shidoka-icons-3b793be1.js";import{FormMixin as u}from"../../../common/mixins/form-input.js";import"./fileUploaderListContainer.js";import"../button/button.js";import"../loaders/loader.js";import"../loaders/inline.js";import"../loaders/skeleton.js";import"../inlineConfirm/inlineConfirm.js";import"../notification/notification.js";import"../notification/notificationContainer.js";import"../link/link.js";import"../../../vendor/lit-html-29220869.js";import"../link/defs.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../../../vendor/lottie-web-9ccae634.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../card/card.js";import"../card/vitalCard.skeleton.js";import"../../../cardSample-37bc81e6.js";import"../card/informationalCard.skeleton.js";import"../tag/tag.js";import"../../../tag-f3175688.js";import"../tag/tagGroup.js";import"../tag/tag.skeleton.js";var v=r`*,
1
+ import{_ as i}from"../../../vendor/tslib-53a81efe.js";import{o as e,c as t,n as l,t as a,i as n,e as o}from"../../../vendor/lit-461e78e6.js";import{i as r,x as s,s as d}from"../../../vendor/lit-element-c6c02f24.js";import{d as c}from"../../../vendor/deepmerge-ts-e62363e6.js";import{Q as p,R as h,S as f,T as g,U as m}from"../../../vendor/@kyndryl-design-system/shidoka-icons-24ba60f3.js";import{FormMixin as u}from"../../../common/mixins/form-input.js";import"./fileUploaderListContainer.js";import"../button/button.js";import"../loaders/loader.js";import"../loaders/inline.js";import"../loaders/skeleton.js";import"../inlineConfirm/inlineConfirm.js";import"../notification/notification.js";import"../notification/notificationContainer.js";import"../link/link.js";import"../../../vendor/lit-html-29220869.js";import"../link/defs.js";import"../../../common/helpers/helpers.js";import"../button/defs.js";import"../../../vendor/lottie-web-9ccae634.js";import"../../../vendor/flatpickr-bbd13d61.js";import"../card/card.js";import"../card/vitalCard.skeleton.js";import"../../../cardSample-37bc81e6.js";import"../card/informationalCard.skeleton.js";import"../tag/tag.js";import"../../../tag-f2565c2b.js";import"../tag/tagGroup.js";import"../tag/tag.skeleton.js";var v=r`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -189,7 +189,11 @@ import{_ as i}from"../../../vendor/tslib-53a81efe.js";import{o as e,c as t,n as
189
189
  .file-uploader-container .file-info-container {
190
190
  display: flex;
191
191
  flex-direction: column;
192
- gap: 24px;
192
+ gap: 16px;
193
+ }
194
+ .file-uploader-container .file-info-container.border-and-padding {
195
+ border-top: 1px solid var(--kd-color-border-accent-secondary);
196
+ padding-top: 16px;
193
197
  }
194
198
  .file-uploader-container .error-filled-icon {
195
199
  display: flex;
@@ -288,9 +292,8 @@ import{_ as i}from"../../../vendor/tslib-53a81efe.js";import{o as e,c as t,n as
288
292
  align-items: center;
289
293
  }
290
294
  .file-uploader-container .file-uploader-item-container {
291
- height: 74px;
292
- padding: 16px 16px 16px 0;
293
- border-bottom: 1px solid var(--kd-color-border-accent-secondary);
295
+ height: 64px;
296
+ padding: 8px 16px 8px 0;
294
297
  display: flex;
295
298
  flex-wrap: wrap;
296
299
  }
@@ -340,7 +343,9 @@ import{_ as i}from"../../../vendor/tslib-53a81efe.js";import{o as e,c as t,n as
340
343
  </div>
341
344
  </div>
342
345
  <!-- File list -->
343
- <div class="file-info-container">
346
+ <div
347
+ class=${e({"file-info-container":!0,"border-and-padding":this._validFiles.length>0||this._invalidFiles.length>0})}
348
+ >
344
349
  <!-- Invalid files -->
345
350
  ${this._invalidFiles.length>0?s`
346
351
  <kyn-file-uploader-list-container
@@ -412,14 +417,14 @@ import{_ as i}from"../../../vendor/tslib-53a81efe.js";import{o as e,c as t,n as
412
417
  </div>
413
418
  `}handleDragOver(i){i.preventDefault(),i.stopPropagation(),this._dragging=!0}handleDrop(i){var e;if(i.preventDefault(),i.stopPropagation(),this._dragging=!1,this._showValidationNotification=!1,!this.disabled&&(null===(e=i.dataTransfer)||void 0===e?void 0:e.files)){const e=Array.from(i.dataTransfer.files);this._validateFiles(e),this._validate(!0,!1),this._setFormValue(),this._emitFileUploadEvent()}}_triggerFileSelect(){var i;const e=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector("#fileInput");null==e||e.click()}handleFileChange(i){this._showValidationNotification=!1;const e=i.target;if(e.files){const i=Array.from(e.files);this._validateFiles(i),this._validate(!0,!1),this._setFormValue(),this._emitFileUploadEvent()}}_getFilesSize(i){if(i<1024)return`${i} Bytes`;if(i<1048576){const e=i/1024;return e%1==0?`${Math.floor(e)} KB`:`${e.toFixed(2)} KB`}if(i<1073741824){const e=i/1048576;return e%1==0?`${Math.floor(e)} MB`:`${e.toFixed(2)} MB`}{const e=i/1073741824;return e%1==0?`${Math.floor(e)} GB`:`${e.toFixed(2)} GB`}}_clearInvalidFiles(){this._invalidFiles=[],this._emitFileUploadEvent()}_validateFiles(i){if(!this.multiple&&i.length>1)return void(this._showValidationNotification=!0);const e=this.multiple?[...this._validFiles]:[],t=this.multiple?[...this._invalidFiles]:[];i.forEach((i=>{const l=i.name,a=i.type,n=i.size,o=this.accept.includes("image/*"),r=this.accept.includes("audio/*"),s=this.accept.includes("video/*"),d=(l.split(".").pop()||"").replace(/^/,".");this.accept.includes(a);const c=0===this.accept.length||o&&a.includes("image")||r&&a.includes("audio")||s&&a.includes("video")||this.accept.includes(a)||this.accept.includes(d),p=n<=this.maxFileSize,h=e.some((e=>e.file.name===i.name)),f=t.some((e=>e.file.name===i.name));if(c&&p&&!h)e.push({file:i,id:l,status:"new"});else if(!(c&&p||f)){let e="";e=c?p?"unknownError":"sizeError":"typeError",t.push({file:i,id:l,status:e})}})),(e.length>0||!this.multiple)&&(this._validFiles=e),(t.length>0||!this.multiple)&&(this._invalidFiles=t)}_validate(i,e){const t=""!==this.invalidText?{...this._inputEl.validity,customError:!0}:this._inputEl.validity;let l="";if(this._invalidFiles.length>0){const i=this._invalidFiles.some((i=>"typeError"===i.status)),e=this._invalidFiles.some((i=>"sizeError"===i.status));l=i&&e?"Invalid file type and Exceeds maximum file size":i?"Invalid file type":"Exceeds maximum file size"}const a=""!==this.invalidText?this.invalidText:l;(i||""!==this.invalidText)&&(this._internals.setValidity(t,a),i&&(this._internalValidationMsg=l)),e&&this._internals.reportValidity()}_setFormValue(){const i=new FormData;this._validFiles.forEach((e=>{const{file:t}=e;i.append(this.name,t)})),this._internals.setFormValue(i)}_displayActions(i){return"uploading"===i.status?s` <kyn-loader-inline></kyn-loader-inline> `:"uploaded"===i.status?s`
414
419
  <span class="success-icon">${t(f)}</span>
415
- `:"error"===i.status?s` <span class="error-icon">${t(m)}</span> `:s` <kyn-inline-confirm
420
+ `:"error"===i.status?s` <span class="error-icon">${t(g)}</span> `:s` <kyn-inline-confirm
416
421
  ?destructive=${!0}
417
422
  .anchorText=${this._textStrings.inlineConfirmAnchorText}
418
423
  .confirmText=${this._textStrings.inlineConfirmConfirmText}
419
424
  .cancelText=${this._textStrings.inlineConfirmCancelText}
420
425
  @on-confirm=${()=>this._deleteFile(i.id)}
421
426
  >
422
- <span>${t(g)}</span>
423
- <span slot="confirmIcon">${t(g)}</span>
427
+ <span>${t(m)}</span>
428
+ <span slot="confirmIcon">${t(m)}</span>
424
429
  </kyn-inline-confirm>`}_deleteFile(i){var e;this._validFiles=this._validFiles.filter((e=>e.id!==i));(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("#fileInput")).value="",this._setFormValue(),this._emitFileUploadEvent()}_emitFileUploadEvent(){const i=new CustomEvent("selected-files",{detail:{validFiles:this._validFiles,invalidFiles:this._invalidFiles}});this.dispatchEvent(i)}};x.styles=v,i([l({type:Array})],x.prototype,"accept",void 0),i([l({type:Boolean})],x.prototype,"multiple",void 0),i([l({type:Object})],x.prototype,"textStrings",void 0),i([l({type:Number})],x.prototype,"maxFileSize",void 0),i([l({type:Boolean})],x.prototype,"disabled",void 0),i([l({type:Array})],x.prototype,"validFiles",void 0),i([l({type:Array})],x.prototype,"invalidFiles",void 0),i([a()],x.prototype,"_textStrings",void 0),i([a()],x.prototype,"_dragging",void 0),i([a()],x.prototype,"_invalidFiles",void 0),i([a()],x.prototype,"_validFiles",void 0),i([a()],x.prototype,"_showValidationNotification",void 0),i([n("input")],x.prototype,"_inputEl",void 0),x=i([o("kyn-file-uploader")],x);export{x as FileUploader};
425
430
  //# sourceMappingURL=fileUploader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileUploader.js","sources":["../../../../src/components/reusable/fileUploader/fileUploader.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { deepmerge } from 'deepmerge-ts';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport uploadIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/24/upload.svg';\nimport errorFilledIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/20/error-filled.svg';\nimport deleteIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/20/delete.svg';\nimport checkmarkIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/24/checkmark.svg';\nimport errorIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/24/error.svg';\nimport { FormMixin } from '../../../common/mixins/form-input';\nimport FileUploaderScss from './fileUploader.scss';\nimport './fileUploaderListContainer';\nimport '../button';\nimport '../loaders';\nimport '../inlineConfirm';\nimport '../notification';\n\nconst _defaultTextStrings = {\n dragAndDropText: 'Drag files here to upload',\n separatorText: 'or',\n buttonText: 'Browse files',\n maxFileSizeText: 'Max file size',\n supportedFileTypeText: 'Supported file type: ',\n fileTypeDisplyText: 'Any file type',\n invalidFileListLabel: 'Some files could not be added:',\n validFileListLabel: 'Files added:',\n clearListText: 'Clear list',\n fileTypeErrorText: 'Invaild file type',\n fileSizeErrorText: 'Max file size exceeded',\n customFileErrorText: 'Custom file error',\n inlineConfirmAnchorText: 'Delete',\n inlineConfirmConfirmText: 'Confirm',\n inlineConfirmCancelText: 'Cancel',\n validationNotificationTitle: 'Multiple files not allowed',\n validationNotificationMessage: 'Please select only one file.',\n};\n\n/**\n * File Uploader\n * @fires selected-files - Emits the uploaded files.\n * @slot upload-status - Slot for upload status/notification.\n */\n@customElement('kyn-file-uploader')\nexport class FileUploader extends FormMixin(LitElement) {\n static override styles = FileUploaderScss;\n\n /**\n * Set the file types that the component accepts. By default, it accepts all file types.\n * @example\n * ['image/jpeg', 'image/png']\n * ['image/*']\n * ['audio/*']\n * ['application/pdf', 'text/plain']\n */\n @property({ type: Array })\n accept: string[] = [];\n\n /**\n * Accept multiple files. Default value is `false`.\n */\n @property({ type: Boolean })\n multiple = false;\n\n /**\n * Customizable text strings.\n */\n @property({ type: Object })\n textStrings = _defaultTextStrings;\n\n /**\n * Set the maximum file size in bytes. Default value is `1048576` (1MB).\n * @example\n * 1048576 // 1MB\n * 5242880 // 5MB\n * 1073741824 // 1GB\n */\n @property({ type: Number })\n maxFileSize = 1048576; // 1MB\n\n /**\n * Disable the file uploader. Default value is `false`.\n */\n @property({ type: Boolean })\n disabled = false;\n\n /**\n * Valid files. This property is used to set the initial or updated state of the valid files.\n */\n @property({ type: Array })\n validFiles: {\n id: string;\n file: File;\n status: 'new' | 'uploading' | 'uploaded' | 'error';\n }[] = [];\n\n /**\n * Invalid files. This property is used to set the initial state of the invalid files.\n */\n @property({ type: Array })\n invalidFiles: {\n id: string;\n file: File;\n status: 'sizeError' | 'typeError' | 'unknownError';\n }[] = [];\n\n /**\n * Internal text strings.\n * @internal\n */\n @state()\n _textStrings = _defaultTextStrings;\n\n /**\n * Internal dragging state.\n * @internal\n */\n @state()\n _dragging = false;\n\n /**\n * Internal invalid files.\n * @internal\n */\n @state()\n _invalidFiles: Object[] = [];\n\n /**\n * Internal valid files.\n * @internal\n */\n @state()\n _validFiles: Object[] = [];\n\n /**\n * Internal notification message flag.\n * @internal\n */\n @state()\n _showValidationNotification = false;\n\n /**\n * Queries the <input> DOM element.\n * @ignore\n */\n @query('input')\n _inputEl!: HTMLInputElement;\n\n override willUpdate(changedProps: any) {\n if (changedProps.has('textStrings')) {\n this._textStrings = deepmerge(_defaultTextStrings, this.textStrings);\n }\n if (changedProps.has('validFiles')) {\n this._validFiles = this.validFiles;\n this._setFormValue();\n }\n if (changedProps.has('invalidFiles')) {\n this._invalidFiles = this.invalidFiles;\n }\n }\n\n override updated(changedProps: any) {\n if (changedProps.has('validFiles')) {\n this._validFiles = this.validFiles;\n this._setFormValue();\n }\n if (changedProps.has('invalidFiles')) {\n this._invalidFiles = this.invalidFiles;\n }\n }\n\n override render() {\n const dragDropContainerClasses = {\n 'drag-drop-container': true,\n dragging: this._dragging,\n disabled: this.disabled,\n };\n return html`\n <div class=\"file-uploader-container\">\n <!-- Drag and drop container -->\n <div class=\"drag-drop-container-wrapper\">\n <div\n class=${classMap(dragDropContainerClasses)}\n @dragover=\"${this.handleDragOver}\"\n @dragleave=\"${() => (this._dragging = false)}\"\n @drop=\"${this.handleDrop}\"\n >\n <div class=\"uploader-status-icon\">\n <span>${unsafeSVG(uploadIcon)}</span>\n </div>\n <p class=\"drag-drop-text\">${this._textStrings.dragAndDropText}</p>\n <p class=\"or-text\">${this._textStrings.separatorText}</p>\n <kyn-button\n kind=\"outline\"\n size=\"small\"\n ?disabled=${this.disabled}\n @on-click=\"${this._triggerFileSelect}\"\n >\n ${this._textStrings.buttonText}\n </kyn-button>\n <input\n class=\"file-input\"\n type=\"file\"\n @change=\"${(e: any) => this.handleFileChange(e)}\"\n id=\"fileInput\"\n accept=${this.accept.length > 0 ? this.accept.join(',') : '*/*'}\n ?multiple=${this.multiple}\n />\n </div>\n <div\n class=${classMap({\n 'upload-constraints': true,\n disabled: this.disabled,\n })}\n >\n <p>\n ${this._textStrings.maxFileSizeText}\n <strong>${this._getFilesSize(this.maxFileSize)}</strong>.\n ${this._textStrings.supportedFileTypeText}\n <strong>${this._textStrings.fileTypeDisplyText}</strong>.\n </p>\n </div>\n </div>\n <!-- File list -->\n <div class=\"file-info-container\">\n <!-- Invalid files -->\n ${this._invalidFiles.length > 0\n ? html`\n <kyn-file-uploader-list-container\n id=\"invalidFiles\"\n .titleText=${this._textStrings.invalidFileListLabel}\n >\n ${this._invalidFiles.length > 0\n ? this._invalidFiles.map(\n (file: any) => html`\n <div class=\"file-uploader-item-container\">\n <span class=\"error-filled-icon\"\n >${unsafeSVG(errorFilledIcon)}</span\n >\n <div class=\"file-details-container\">\n <p class=\"file-name\">${file.file.name}</p>\n <div class=\"error-info-container\">\n <p class=\"file-size\">\n ${this._getFilesSize(file.file.size)}\n </p>\n ·\n <p class=\"file-size error\">\n ${file.status === 'unknownError'\n ? this._textStrings.customFileErrorText\n : file.status === 'typeError'\n ? this._textStrings.fileTypeErrorText\n : this._textStrings.fileSizeErrorText}\n </p>\n </div>\n </div>\n </div>\n `\n )\n : ''}\n <kyn-button\n slot=\"action-button\"\n kind=\"ghost\"\n size=\"small\"\n @on-click=${this._clearInvalidFiles}\n >\n ${this._textStrings.clearListText}\n </kyn-button>\n </kyn-file-uploader-list-container>\n `\n : ''}\n <!-- Valid files -->\n ${this._validFiles.length > 0\n ? html`\n <kyn-file-uploader-list-container\n .titleText=${this._textStrings.validFileListLabel}\n id=\"validFiles\"\n >\n ${this._validFiles.length > 0\n ? this._validFiles.map(\n (file: any) => html`\n <div class=\"file-uploader-item-container\">\n <div class=\"file-details-container\">\n <p class=\"file-name success\">${file.file.name}</p>\n <p class=\"file-size\">\n ${this._getFilesSize(file.file.size)}\n </p>\n </div>\n <div class=\"actions\">\n ${this._displayActions(file)}\n </div>\n </div>\n `\n )\n : ''}\n </kyn-file-uploader-list-container>\n `\n : ''}\n </div>\n ${this._showValidationNotification\n ? html` <kyn-notification\n .type=${'inline'}\n .tagStatus=${'error'}\n .notificationTitle=${this._textStrings\n .validationNotificationTitle}\n @on-close=${() => {\n this._showValidationNotification = false;\n }}\n >\n ${this._textStrings.validationNotificationMessage}\n </kyn-notification>`\n : ''}\n <div class=\"upload-status-container\">\n <slot name=\"upload-status\"></slot>\n </div>\n </div>\n `;\n }\n\n handleDragOver(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._dragging = true;\n }\n\n handleDrop(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._dragging = false;\n this._showValidationNotification = false;\n if (this.disabled) return;\n\n if (event.dataTransfer?.files) {\n const files = Array.from(event.dataTransfer.files);\n\n this._validateFiles(files);\n this._validate(true, false);\n this._setFormValue();\n this._emitFileUploadEvent();\n }\n }\n\n private _triggerFileSelect() {\n const fileInputElement = this.shadowRoot?.querySelector(\n '#fileInput'\n ) as HTMLInputElement;\n fileInputElement?.click();\n }\n\n handleFileChange(event: Event) {\n this._showValidationNotification = false;\n const target = event.target as HTMLInputElement;\n if (target.files) {\n const files = Array.from(target.files);\n\n this._validateFiles(files);\n this._validate(true, false);\n this._setFormValue();\n this._emitFileUploadEvent();\n }\n }\n\n private _getFilesSize(bytes: number) {\n if (bytes < 1024) {\n return `${bytes} Bytes`;\n } else if (bytes < 1024 * 1024) {\n const kb = bytes / 1024;\n return kb % 1 === 0 ? `${Math.floor(kb)} KB` : `${kb.toFixed(2)} KB`;\n } else if (bytes < 1024 * 1024 * 1024) {\n const mb = bytes / (1024 * 1024);\n return mb % 1 === 0 ? `${Math.floor(mb)} MB` : `${mb.toFixed(2)} MB`;\n } else {\n const gb = bytes / (1024 * 1024 * 1024);\n return gb % 1 === 0 ? `${Math.floor(gb)} GB` : `${gb.toFixed(2)} GB`;\n }\n }\n\n private _clearInvalidFiles() {\n this._invalidFiles = [];\n this._emitFileUploadEvent();\n }\n\n // Validate files\n private _validateFiles(files: File[]) {\n // Check if multiple files are uploaded\n if (!this.multiple && files.length > 1) {\n this._showValidationNotification = true;\n return;\n }\n\n const validFiles: Object[] = this.multiple ? [...this._validFiles] : [];\n const invalidFiles: Object[] = this.multiple ? [...this._invalidFiles] : [];\n\n files.forEach((file) => {\n const fileName = file.name;\n const fileType = file.type;\n const fileSize = file.size;\n\n // Check if the file type is valid\n const imageWildcard = this.accept.includes('image/*');\n const audioWildcard = this.accept.includes('audio/*');\n const videoWildcard = this.accept.includes('video/*');\n\n const fileExtension = (fileName.split('.').pop() || '').replace(/^/, '.');\n this.accept.includes(fileType);\n\n const isValidType =\n this.accept.length === 0 ||\n (imageWildcard && fileType.includes('image')) ||\n (audioWildcard && fileType.includes('audio')) ||\n (videoWildcard && fileType.includes('video')) ||\n this.accept.includes(fileType) ||\n this.accept.includes(fileExtension);\n\n // Check if the file size is valid\n const isValidSize = fileSize <= this.maxFileSize;\n\n const fileAlreadyValid = validFiles.some(\n (existingFile: any) => existingFile.file.name === file.name\n );\n const fileAlreadyInvalid = invalidFiles.some(\n (existingFile: any) => existingFile.file.name === file.name\n );\n\n if (isValidType && isValidSize && !fileAlreadyValid) {\n validFiles.push({\n file,\n id: fileName,\n status: 'new',\n });\n } else if ((!isValidType || !isValidSize) && !fileAlreadyInvalid) {\n let errorMsg = '';\n if (!isValidType) {\n errorMsg = 'typeError';\n } else if (!isValidSize) {\n errorMsg = 'sizeError';\n } else {\n errorMsg = 'unknownError';\n }\n invalidFiles.push({\n file,\n id: fileName,\n status: errorMsg,\n });\n }\n });\n\n // Update valid files\n if (validFiles.length > 0 || !this.multiple) {\n this._validFiles = validFiles;\n }\n\n // Update invalid files\n if (invalidFiles.length > 0 || !this.multiple) {\n this._invalidFiles = invalidFiles;\n }\n }\n\n private _validate(interacted: Boolean, report: Boolean) {\n const Validity =\n this.invalidText !== ''\n ? { ...this._inputEl.validity, customError: true }\n : this._inputEl.validity;\n\n let InternalMsg = '';\n if (this._invalidFiles.length > 0) {\n const hasTypeError = this._invalidFiles.some(\n (file: any) => file.status === 'typeError'\n );\n const hasSizeError = this._invalidFiles.some(\n (file: any) => file.status === 'sizeError'\n );\n InternalMsg =\n hasTypeError && hasSizeError\n ? 'Invalid file type and Exceeds maximum file size'\n : hasTypeError\n ? 'Invalid file type'\n : 'Exceeds maximum file size';\n }\n\n const ValidationMessage =\n this.invalidText !== '' ? this.invalidText : InternalMsg;\n\n if (interacted || this.invalidText !== '') {\n this._internals.setValidity(Validity, ValidationMessage);\n\n // set internal validation message if value was changed by user input\n if (interacted) {\n this._internalValidationMsg = InternalMsg;\n }\n }\n\n if (report) {\n this._internals.reportValidity();\n }\n }\n\n private _setFormValue() {\n const formData = new FormData();\n this._validFiles.forEach((fileObj: any) => {\n const { file } = fileObj;\n formData.append(this.name, file);\n });\n this._internals.setFormValue(formData);\n }\n\n private _displayActions(file: any) {\n if (file.status === 'uploading') {\n return html` <kyn-loader-inline></kyn-loader-inline> `;\n } else if (file.status === 'uploaded') {\n return html`\n <span class=\"success-icon\">${unsafeSVG(checkmarkIcon)}</span>\n `;\n } else if (file.status === 'error') {\n return html` <span class=\"error-icon\">${unsafeSVG(errorIcon)}</span> `;\n } else {\n return html` <kyn-inline-confirm\n ?destructive=${true}\n .anchorText=${this._textStrings.inlineConfirmAnchorText}\n .confirmText=${this._textStrings.inlineConfirmConfirmText}\n .cancelText=${this._textStrings.inlineConfirmCancelText}\n @on-confirm=${() => this._deleteFile(file.id)}\n >\n <span>${unsafeSVG(deleteIcon)}</span>\n <span slot=\"confirmIcon\">${unsafeSVG(deleteIcon)}</span>\n </kyn-inline-confirm>`;\n }\n }\n\n private _deleteFile(fileId: string) {\n this._validFiles = this._validFiles.filter(\n (file: any) => file.id !== fileId\n );\n const fileInputElement = this.shadowRoot?.querySelector(\n '#fileInput'\n ) as HTMLInputElement;\n fileInputElement.value = ''; // Clear the file input value\n this._setFormValue();\n this._emitFileUploadEvent();\n }\n\n private _emitFileUploadEvent() {\n const event = new CustomEvent('selected-files', {\n detail: {\n validFiles: this._validFiles,\n invalidFiles: this._invalidFiles,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-file-uploader': FileUploader;\n }\n}\n"],"names":["_defaultTextStrings","dragAndDropText","separatorText","buttonText","maxFileSizeText","supportedFileTypeText","fileTypeDisplyText","invalidFileListLabel","validFileListLabel","clearListText","fileTypeErrorText","fileSizeErrorText","customFileErrorText","inlineConfirmAnchorText","inlineConfirmConfirmText","inlineConfirmCancelText","validationNotificationTitle","validationNotificationMessage","FileUploader","FormMixin","LitElement","constructor","this","accept","multiple","textStrings","maxFileSize","disabled","validFiles","invalidFiles","_textStrings","_dragging","_invalidFiles","_validFiles","_showValidationNotification","willUpdate","changedProps","has","deepmerge","_setFormValue","updated","render","dragDropContainerClasses","dragging","html","classMap","handleDragOver","handleDrop","unsafeSVG","uploadIcon","_triggerFileSelect","e","handleFileChange","length","join","_getFilesSize","map","file","errorFilledIcon","name","size","status","_clearInvalidFiles","_displayActions","event","preventDefault","stopPropagation","dataTransfer","_a","files","Array","from","_validateFiles","_validate","_emitFileUploadEvent","fileInputElement","shadowRoot","querySelector","click","target","bytes","kb","Math","floor","toFixed","mb","gb","forEach","fileName","fileType","type","fileSize","imageWildcard","includes","audioWildcard","videoWildcard","fileExtension","split","pop","replace","isValidType","isValidSize","fileAlreadyValid","some","existingFile","fileAlreadyInvalid","push","id","errorMsg","interacted","report","Validity","invalidText","_inputEl","validity","customError","InternalMsg","hasTypeError","hasSizeError","ValidationMessage","_internals","setValidity","_internalValidationMsg","reportValidity","formData","FormData","fileObj","append","setFormValue","checkmarkIcon","errorIcon","_deleteFile","deleteIcon","fileId","filter","value","CustomEvent","detail","dispatchEvent","styles","FileUploaderScss","__decorate","property","prototype","Boolean","Object","Number","state","query","customElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAA6H,UAAA,iBAAA,GAOlBF,EAAA,CADCM,KAC4BjI,EAAA6H,UAAA,qBAAA,GAO7BF,EAAA,CADCM,KAC0BjI,EAAA6H,UAAA,mBAAA,GAO3BF,EAAA,CADCM,KACmCjI,EAAA6H,UAAA,mCAAA,GAOpCF,EAAA,CADCO,EAAM,UACqBlI,EAAA6H,UAAA,gBAAA,GAtGjB7H,EAAY2H,EAAA,CADxBQ,EAAc,sBACFnI"}
1
+ {"version":3,"file":"fileUploader.js","sources":["../../../../src/components/reusable/fileUploader/fileUploader.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { deepmerge } from 'deepmerge-ts';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport uploadIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/24/upload.svg';\nimport errorFilledIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/20/error-filled.svg';\nimport deleteIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/20/delete.svg';\nimport checkmarkIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/24/checkmark.svg';\nimport errorIcon from '@kyndryl-design-system/shidoka-icons/svg/monochrome/24/error.svg';\nimport { FormMixin } from '../../../common/mixins/form-input';\nimport FileUploaderScss from './fileUploader.scss';\nimport './fileUploaderListContainer';\nimport '../button';\nimport '../loaders';\nimport '../inlineConfirm';\nimport '../notification';\n\nconst _defaultTextStrings = {\n dragAndDropText: 'Drag files here to upload',\n separatorText: 'or',\n buttonText: 'Browse files',\n maxFileSizeText: 'Max file size',\n supportedFileTypeText: 'Supported file type: ',\n fileTypeDisplyText: 'Any file type',\n invalidFileListLabel: 'Some files could not be added:',\n validFileListLabel: 'Files added:',\n clearListText: 'Clear list',\n fileTypeErrorText: 'Invaild file type',\n fileSizeErrorText: 'Max file size exceeded',\n customFileErrorText: 'Custom file error',\n inlineConfirmAnchorText: 'Delete',\n inlineConfirmConfirmText: 'Confirm',\n inlineConfirmCancelText: 'Cancel',\n validationNotificationTitle: 'Multiple files not allowed',\n validationNotificationMessage: 'Please select only one file.',\n};\n\n/**\n * File Uploader\n * @fires selected-files - Emits the uploaded files.\n * @slot upload-status - Slot for upload status/notification.\n */\n@customElement('kyn-file-uploader')\nexport class FileUploader extends FormMixin(LitElement) {\n static override styles = FileUploaderScss;\n\n /**\n * Set the file types that the component accepts. By default, it accepts all file types.\n * @example\n * ['image/jpeg', 'image/png']\n * ['image/*']\n * ['audio/*']\n * ['application/pdf', 'text/plain']\n */\n @property({ type: Array })\n accept: string[] = [];\n\n /**\n * Accept multiple files. Default value is `false`.\n */\n @property({ type: Boolean })\n multiple = false;\n\n /**\n * Customizable text strings.\n */\n @property({ type: Object })\n textStrings = _defaultTextStrings;\n\n /**\n * Set the maximum file size in bytes. Default value is `1048576` (1MB).\n * @example\n * 1048576 // 1MB\n * 5242880 // 5MB\n * 1073741824 // 1GB\n */\n @property({ type: Number })\n maxFileSize = 1048576; // 1MB\n\n /**\n * Disable the file uploader. Default value is `false`.\n */\n @property({ type: Boolean })\n disabled = false;\n\n /**\n * Valid files. This property is used to set the initial or updated state of the valid files.\n */\n @property({ type: Array })\n validFiles: {\n id: string;\n file: File;\n status: 'new' | 'uploading' | 'uploaded' | 'error';\n }[] = [];\n\n /**\n * Invalid files. This property is used to set the initial state of the invalid files.\n */\n @property({ type: Array })\n invalidFiles: {\n id: string;\n file: File;\n status: 'sizeError' | 'typeError' | 'unknownError';\n }[] = [];\n\n /**\n * Internal text strings.\n * @internal\n */\n @state()\n _textStrings = _defaultTextStrings;\n\n /**\n * Internal dragging state.\n * @internal\n */\n @state()\n _dragging = false;\n\n /**\n * Internal invalid files.\n * @internal\n */\n @state()\n _invalidFiles: Object[] = [];\n\n /**\n * Internal valid files.\n * @internal\n */\n @state()\n _validFiles: Object[] = [];\n\n /**\n * Internal notification message flag.\n * @internal\n */\n @state()\n _showValidationNotification = false;\n\n /**\n * Queries the <input> DOM element.\n * @ignore\n */\n @query('input')\n _inputEl!: HTMLInputElement;\n\n override willUpdate(changedProps: any) {\n if (changedProps.has('textStrings')) {\n this._textStrings = deepmerge(_defaultTextStrings, this.textStrings);\n }\n if (changedProps.has('validFiles')) {\n this._validFiles = this.validFiles;\n this._setFormValue();\n }\n if (changedProps.has('invalidFiles')) {\n this._invalidFiles = this.invalidFiles;\n }\n }\n\n override updated(changedProps: any) {\n if (changedProps.has('validFiles')) {\n this._validFiles = this.validFiles;\n this._setFormValue();\n }\n if (changedProps.has('invalidFiles')) {\n this._invalidFiles = this.invalidFiles;\n }\n }\n\n override render() {\n const dragDropContainerClasses = {\n 'drag-drop-container': true,\n dragging: this._dragging,\n disabled: this.disabled,\n };\n return html`\n <div class=\"file-uploader-container\">\n <!-- Drag and drop container -->\n <div class=\"drag-drop-container-wrapper\">\n <div\n class=${classMap(dragDropContainerClasses)}\n @dragover=\"${this.handleDragOver}\"\n @dragleave=\"${() => (this._dragging = false)}\"\n @drop=\"${this.handleDrop}\"\n >\n <div class=\"uploader-status-icon\">\n <span>${unsafeSVG(uploadIcon)}</span>\n </div>\n <p class=\"drag-drop-text\">${this._textStrings.dragAndDropText}</p>\n <p class=\"or-text\">${this._textStrings.separatorText}</p>\n <kyn-button\n kind=\"outline\"\n size=\"small\"\n ?disabled=${this.disabled}\n @on-click=\"${this._triggerFileSelect}\"\n >\n ${this._textStrings.buttonText}\n </kyn-button>\n <input\n class=\"file-input\"\n type=\"file\"\n @change=\"${(e: any) => this.handleFileChange(e)}\"\n id=\"fileInput\"\n accept=${this.accept.length > 0 ? this.accept.join(',') : '*/*'}\n ?multiple=${this.multiple}\n />\n </div>\n <div\n class=${classMap({\n 'upload-constraints': true,\n disabled: this.disabled,\n })}\n >\n <p>\n ${this._textStrings.maxFileSizeText}\n <strong>${this._getFilesSize(this.maxFileSize)}</strong>.\n ${this._textStrings.supportedFileTypeText}\n <strong>${this._textStrings.fileTypeDisplyText}</strong>.\n </p>\n </div>\n </div>\n <!-- File list -->\n <div\n class=${classMap({\n 'file-info-container': true,\n 'border-and-padding':\n this._validFiles.length > 0 || this._invalidFiles.length > 0,\n })}\n >\n <!-- Invalid files -->\n ${this._invalidFiles.length > 0\n ? html`\n <kyn-file-uploader-list-container\n id=\"invalidFiles\"\n .titleText=${this._textStrings.invalidFileListLabel}\n >\n ${this._invalidFiles.length > 0\n ? this._invalidFiles.map(\n (file: any) => html`\n <div class=\"file-uploader-item-container\">\n <span class=\"error-filled-icon\"\n >${unsafeSVG(errorFilledIcon)}</span\n >\n <div class=\"file-details-container\">\n <p class=\"file-name\">${file.file.name}</p>\n <div class=\"error-info-container\">\n <p class=\"file-size\">\n ${this._getFilesSize(file.file.size)}\n </p>\n ·\n <p class=\"file-size error\">\n ${file.status === 'unknownError'\n ? this._textStrings.customFileErrorText\n : file.status === 'typeError'\n ? this._textStrings.fileTypeErrorText\n : this._textStrings.fileSizeErrorText}\n </p>\n </div>\n </div>\n </div>\n `\n )\n : ''}\n <kyn-button\n slot=\"action-button\"\n kind=\"ghost\"\n size=\"small\"\n @on-click=${this._clearInvalidFiles}\n >\n ${this._textStrings.clearListText}\n </kyn-button>\n </kyn-file-uploader-list-container>\n `\n : ''}\n <!-- Valid files -->\n ${this._validFiles.length > 0\n ? html`\n <kyn-file-uploader-list-container\n .titleText=${this._textStrings.validFileListLabel}\n id=\"validFiles\"\n >\n ${this._validFiles.length > 0\n ? this._validFiles.map(\n (file: any) => html`\n <div class=\"file-uploader-item-container\">\n <div class=\"file-details-container\">\n <p class=\"file-name success\">${file.file.name}</p>\n <p class=\"file-size\">\n ${this._getFilesSize(file.file.size)}\n </p>\n </div>\n <div class=\"actions\">\n ${this._displayActions(file)}\n </div>\n </div>\n `\n )\n : ''}\n </kyn-file-uploader-list-container>\n `\n : ''}\n </div>\n ${this._showValidationNotification\n ? html` <kyn-notification\n .type=${'inline'}\n .tagStatus=${'error'}\n .notificationTitle=${this._textStrings\n .validationNotificationTitle}\n @on-close=${() => {\n this._showValidationNotification = false;\n }}\n >\n ${this._textStrings.validationNotificationMessage}\n </kyn-notification>`\n : ''}\n <div class=\"upload-status-container\">\n <slot name=\"upload-status\"></slot>\n </div>\n </div>\n `;\n }\n\n handleDragOver(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._dragging = true;\n }\n\n handleDrop(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this._dragging = false;\n this._showValidationNotification = false;\n if (this.disabled) return;\n\n if (event.dataTransfer?.files) {\n const files = Array.from(event.dataTransfer.files);\n\n this._validateFiles(files);\n this._validate(true, false);\n this._setFormValue();\n this._emitFileUploadEvent();\n }\n }\n\n private _triggerFileSelect() {\n const fileInputElement = this.shadowRoot?.querySelector(\n '#fileInput'\n ) as HTMLInputElement;\n fileInputElement?.click();\n }\n\n handleFileChange(event: Event) {\n this._showValidationNotification = false;\n const target = event.target as HTMLInputElement;\n if (target.files) {\n const files = Array.from(target.files);\n\n this._validateFiles(files);\n this._validate(true, false);\n this._setFormValue();\n this._emitFileUploadEvent();\n }\n }\n\n private _getFilesSize(bytes: number) {\n if (bytes < 1024) {\n return `${bytes} Bytes`;\n } else if (bytes < 1024 * 1024) {\n const kb = bytes / 1024;\n return kb % 1 === 0 ? `${Math.floor(kb)} KB` : `${kb.toFixed(2)} KB`;\n } else if (bytes < 1024 * 1024 * 1024) {\n const mb = bytes / (1024 * 1024);\n return mb % 1 === 0 ? `${Math.floor(mb)} MB` : `${mb.toFixed(2)} MB`;\n } else {\n const gb = bytes / (1024 * 1024 * 1024);\n return gb % 1 === 0 ? `${Math.floor(gb)} GB` : `${gb.toFixed(2)} GB`;\n }\n }\n\n private _clearInvalidFiles() {\n this._invalidFiles = [];\n this._emitFileUploadEvent();\n }\n\n // Validate files\n private _validateFiles(files: File[]) {\n // Check if multiple files are uploaded\n if (!this.multiple && files.length > 1) {\n this._showValidationNotification = true;\n return;\n }\n\n const validFiles: Object[] = this.multiple ? [...this._validFiles] : [];\n const invalidFiles: Object[] = this.multiple ? [...this._invalidFiles] : [];\n\n files.forEach((file) => {\n const fileName = file.name;\n const fileType = file.type;\n const fileSize = file.size;\n\n // Check if the file type is valid\n const imageWildcard = this.accept.includes('image/*');\n const audioWildcard = this.accept.includes('audio/*');\n const videoWildcard = this.accept.includes('video/*');\n\n const fileExtension = (fileName.split('.').pop() || '').replace(/^/, '.');\n this.accept.includes(fileType);\n\n const isValidType =\n this.accept.length === 0 ||\n (imageWildcard && fileType.includes('image')) ||\n (audioWildcard && fileType.includes('audio')) ||\n (videoWildcard && fileType.includes('video')) ||\n this.accept.includes(fileType) ||\n this.accept.includes(fileExtension);\n\n // Check if the file size is valid\n const isValidSize = fileSize <= this.maxFileSize;\n\n const fileAlreadyValid = validFiles.some(\n (existingFile: any) => existingFile.file.name === file.name\n );\n const fileAlreadyInvalid = invalidFiles.some(\n (existingFile: any) => existingFile.file.name === file.name\n );\n\n if (isValidType && isValidSize && !fileAlreadyValid) {\n validFiles.push({\n file,\n id: fileName,\n status: 'new',\n });\n } else if ((!isValidType || !isValidSize) && !fileAlreadyInvalid) {\n let errorMsg = '';\n if (!isValidType) {\n errorMsg = 'typeError';\n } else if (!isValidSize) {\n errorMsg = 'sizeError';\n } else {\n errorMsg = 'unknownError';\n }\n invalidFiles.push({\n file,\n id: fileName,\n status: errorMsg,\n });\n }\n });\n\n // Update valid files\n if (validFiles.length > 0 || !this.multiple) {\n this._validFiles = validFiles;\n }\n\n // Update invalid files\n if (invalidFiles.length > 0 || !this.multiple) {\n this._invalidFiles = invalidFiles;\n }\n }\n\n private _validate(interacted: Boolean, report: Boolean) {\n const Validity =\n this.invalidText !== ''\n ? { ...this._inputEl.validity, customError: true }\n : this._inputEl.validity;\n\n let InternalMsg = '';\n if (this._invalidFiles.length > 0) {\n const hasTypeError = this._invalidFiles.some(\n (file: any) => file.status === 'typeError'\n );\n const hasSizeError = this._invalidFiles.some(\n (file: any) => file.status === 'sizeError'\n );\n InternalMsg =\n hasTypeError && hasSizeError\n ? 'Invalid file type and Exceeds maximum file size'\n : hasTypeError\n ? 'Invalid file type'\n : 'Exceeds maximum file size';\n }\n\n const ValidationMessage =\n this.invalidText !== '' ? this.invalidText : InternalMsg;\n\n if (interacted || this.invalidText !== '') {\n this._internals.setValidity(Validity, ValidationMessage);\n\n // set internal validation message if value was changed by user input\n if (interacted) {\n this._internalValidationMsg = InternalMsg;\n }\n }\n\n if (report) {\n this._internals.reportValidity();\n }\n }\n\n private _setFormValue() {\n const formData = new FormData();\n this._validFiles.forEach((fileObj: any) => {\n const { file } = fileObj;\n formData.append(this.name, file);\n });\n this._internals.setFormValue(formData);\n }\n\n private _displayActions(file: any) {\n if (file.status === 'uploading') {\n return html` <kyn-loader-inline></kyn-loader-inline> `;\n } else if (file.status === 'uploaded') {\n return html`\n <span class=\"success-icon\">${unsafeSVG(checkmarkIcon)}</span>\n `;\n } else if (file.status === 'error') {\n return html` <span class=\"error-icon\">${unsafeSVG(errorIcon)}</span> `;\n } else {\n return html` <kyn-inline-confirm\n ?destructive=${true}\n .anchorText=${this._textStrings.inlineConfirmAnchorText}\n .confirmText=${this._textStrings.inlineConfirmConfirmText}\n .cancelText=${this._textStrings.inlineConfirmCancelText}\n @on-confirm=${() => this._deleteFile(file.id)}\n >\n <span>${unsafeSVG(deleteIcon)}</span>\n <span slot=\"confirmIcon\">${unsafeSVG(deleteIcon)}</span>\n </kyn-inline-confirm>`;\n }\n }\n\n private _deleteFile(fileId: string) {\n this._validFiles = this._validFiles.filter(\n (file: any) => file.id !== fileId\n );\n const fileInputElement = this.shadowRoot?.querySelector(\n '#fileInput'\n ) as HTMLInputElement;\n fileInputElement.value = ''; // Clear the file input value\n this._setFormValue();\n this._emitFileUploadEvent();\n }\n\n private _emitFileUploadEvent() {\n const event = new CustomEvent('selected-files', {\n detail: {\n validFiles: this._validFiles,\n invalidFiles: this._invalidFiles,\n },\n });\n this.dispatchEvent(event);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-file-uploader': FileUploader;\n }\n}\n"],"names":["_defaultTextStrings","dragAndDropText","separatorText","buttonText","maxFileSizeText","supportedFileTypeText","fileTypeDisplyText","invalidFileListLabel","validFileListLabel","clearListText","fileTypeErrorText","fileSizeErrorText","customFileErrorText","inlineConfirmAnchorText","inlineConfirmConfirmText","inlineConfirmCancelText","validationNotificationTitle","validationNotificationMessage","FileUploader","FormMixin","LitElement","constructor","this","accept","multiple","textStrings","maxFileSize","disabled","validFiles","invalidFiles","_textStrings","_dragging","_invalidFiles","_validFiles","_showValidationNotification","willUpdate","changedProps","has","deepmerge","_setFormValue","updated","render","dragDropContainerClasses","dragging","html","classMap","handleDragOver","handleDrop","unsafeSVG","uploadIcon","_triggerFileSelect","e","handleFileChange","length","join","_getFilesSize","map","file","errorFilledIcon","name","size","status","_clearInvalidFiles","_displayActions","event","preventDefault","stopPropagation","dataTransfer","_a","files","Array","from","_validateFiles","_validate","_emitFileUploadEvent","fileInputElement","shadowRoot","querySelector","click","target","bytes","kb","Math","floor","toFixed","mb","gb","forEach","fileName","fileType","type","fileSize","imageWildcard","includes","audioWildcard","videoWildcard","fileExtension","split","pop","replace","isValidType","isValidSize","fileAlreadyValid","some","existingFile","fileAlreadyInvalid","push","id","errorMsg","interacted","report","Validity","invalidText","_inputEl","validity","customError","InternalMsg","hasTypeError","hasSizeError","ValidationMessage","_internals","setValidity","_internalValidationMsg","reportValidity","formData","FormData","fileObj","append","setFormValue","checkmarkIcon","errorIcon","_deleteFile","deleteIcon","fileId","filter","value","CustomEvent","detail","dispatchEvent","styles","FileUploaderScss","__decorate","property","prototype","Boolean","Object","Number","state","query","customElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAA,CADCM,KAC4BjI,EAAA6H,UAAA,qBAAA,GAO7BF,EAAA,CADCM,KAC0BjI,EAAA6H,UAAA,mBAAA,GAO3BF,EAAA,CADCM,KACmCjI,EAAA6H,UAAA,mCAAA,GAOpCF,EAAA,CADCO,EAAM,UACqBlI,EAAA6H,UAAA,gBAAA,GAtGjB7H,EAAY2H,EAAA,CADxBQ,EAAc,sBACFnI"}
@@ -1,4 +1,4 @@
1
- import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{n as t,l as i,i as o,t as r,e as l}from"../../../vendor/lit-461e78e6.js";import{i as s,s as a,x as n}from"../../../vendor/lit-element-c6c02f24.js";import"../link/link.js";import"../../../vendor/lit-html-29220869.js";import"../link/defs.js";var d=s`*,
1
+ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{n as t,l as i,i as o,t as r,e as s}from"../../../vendor/lit-461e78e6.js";import{i as l,s as a,x as n}from"../../../vendor/lit-element-c6c02f24.js";import"../link/link.js";import"../../../vendor/lit-html-29220869.js";import"../link/defs.js";var d=l`*,
2
2
  *::before,
3
3
  *::after {
4
4
  box-sizing: border-box;
@@ -51,6 +51,7 @@ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{n as t,l as i,i as
51
51
  font-weight: var(--kd-font-weight-regular);
52
52
  letter-spacing: var(--kd-letter-spacing-4);
53
53
  height: 32px;
54
+ margin-bottom: 8px;
54
55
  }
55
56
  @media (min-width: 42rem) {
56
57
  .file-uploader-list-container__header {
@@ -78,17 +79,19 @@ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{n as t,l as i,i as
78
79
  }
79
80
 
80
81
  .file-uploader-list-container__items {
81
- max-height: 222px;
82
+ max-height: 193px;
82
83
  overflow-y: auto;
83
84
  overflow-x: hidden;
85
+ border-bottom: 1px solid var(--kd-color-border-accent-secondary);
84
86
  }
85
87
 
86
88
  .shadow-bottom {
87
- box-shadow: inset 0px -8px 6px -6px var(--kd-color-utility-elevation-default-l2---overflow);
89
+ box-shadow: inset 0px -8px 6px -6px var(--kd-color-utility-elevation-default-1);
88
90
  }
89
91
 
90
92
  .shadow-top {
91
- box-shadow: inset 0px 8px 6px -6px var(--kd-color-utility-elevation-default-l2---overflow);
93
+ border-top: 1px solid var(--kd-color-border-accent-secondary);
94
+ box-shadow: inset 0px 8px 6px -6px var(--kd-color-utility-elevation-default-1);
92
95
  }`;let h=class extends a{constructor(){super(...arguments),this.titleText="File details",this._scrollHandler=null}get hasMoreThanThreeItems(){return this._fileItems.length>3}firstUpdated(){this.hasMoreThanThreeItems&&(this._container.classList.add("shadow-bottom"),this._addScrollListener())}render(){return n`
93
96
  <div class="file-uploader-list-container">
94
97
  <div class="file-uploader-list-container__header">
@@ -100,5 +103,5 @@ import{_ as e}from"../../../vendor/tslib-53a81efe.js";import{n as t,l as i,i as
100
103
  </div>
101
104
  <!-- footer would go here, if needed. -->
102
105
  </div>
103
- `}_handleSlotChange(){this.hasMoreThanThreeItems?this._addScrollListener():setTimeout((()=>{this._removeScrollListener()}),20),this.requestUpdate()}_addScrollListener(){this._container&&(this._scrollHandler=this._toggleShadowClass.bind(this,this._container),this._container.addEventListener("scroll",this._scrollHandler),this._container.classList.add("shadow-bottom"))}_removeScrollListener(){this._container&&this._scrollHandler&&(this._container.removeEventListener("scroll",this._scrollHandler),this._container.classList.remove("shadow-bottom","shadow-top"))}_toggleShadowClass(e){if(!e)return;const t=0===e.scrollTop,i=e.scrollHeight-e.scrollTop===e.clientHeight;t?setTimeout((()=>{e.classList.add("shadow-bottom"),e.classList.remove("shadow-top")}),5):i&&setTimeout((()=>{e.classList.add("shadow-top"),e.classList.remove("shadow-bottom")}),5)}};h.styles=d,e([t({type:String})],h.prototype,"titleText",void 0),e([i()],h.prototype,"_fileItems",void 0),e([o(".file-uploader-list-container__items")],h.prototype,"_container",void 0),e([r()],h.prototype,"_scrollHandler",void 0),h=e([l("kyn-file-uploader-list-container")],h);export{h as FileUploaderListContainer};
106
+ `}_handleSlotChange(){this.hasMoreThanThreeItems?this._addScrollListener():setTimeout((()=>{this._removeScrollListener()}),20),this.requestUpdate()}_addScrollListener(){this._container&&(this._scrollHandler=this._toggleShadowClass.bind(this,this._container),this._container.addEventListener("scroll",this._scrollHandler),this._container.classList.add("shadow-bottom"))}_removeScrollListener(){this._container&&this._scrollHandler&&(this._container.removeEventListener("scroll",this._scrollHandler),this._container.classList.remove("shadow-bottom","shadow-top"))}_toggleShadowClass(e){if(!e)return;const t=0===e.scrollTop,i=e.scrollHeight-e.scrollTop===e.clientHeight;t?setTimeout((()=>{e.classList.add("shadow-bottom"),e.classList.remove("shadow-top")}),5):i&&setTimeout((()=>{e.classList.add("shadow-top"),e.classList.remove("shadow-bottom")}),5)}};h.styles=d,e([t({type:String})],h.prototype,"titleText",void 0),e([i()],h.prototype,"_fileItems",void 0),e([o(".file-uploader-list-container__items")],h.prototype,"_container",void 0),e([r()],h.prototype,"_scrollHandler",void 0),h=e([s("kyn-file-uploader-list-container")],h);export{h as FileUploaderListContainer};
104
107
  //# sourceMappingURL=fileUploaderListContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileUploaderListContainer.js","sources":["../../../../src/components/reusable/fileUploader/fileUploaderListContainer.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport {\n customElement,\n property,\n query,\n queryAssignedElements,\n state,\n} from 'lit/decorators.js';\nimport FileUploaderListContainerScss from './fileUploaderListContainer.scss';\nimport '../link';\n\n/**\n * File Uploader List Container\n * @slot unnamed - Slot for individual file uploader items.\n * @slot action-button - Slot for action button.\n */\n@customElement('kyn-file-uploader-list-container')\nexport class FileUploaderListContainer extends LitElement {\n static override styles = FileUploaderListContainerScss;\n\n /**\n * File details container title.\n */\n @property({ type: String })\n titleText = 'File details';\n\n /**\n * Show all text.\n */\n // @property({ type: String })\n // showAll = 'Show all files';\n\n /**\n * Show less text.\n */\n // @property({ type: String })\n // showLess = 'Show less files';\n\n /**\n * Limit visible file uploader items.\n * @internal\n */\n // @state()\n // _limitRevealed = false;\n\n /**\n * Queries for all slotted elements.\n * @internal\n */\n @queryAssignedElements()\n _fileItems!: Array<any>;\n\n /**\n * Queries for the items container element.\n * @internal\n */\n @query('.file-uploader-list-container__items')\n _container!: HTMLElement;\n\n /**\n * Scroll event handler.\n * @internal\n */\n @state()\n _scrollHandler: EventListener | null = null;\n\n /**\n * Checks if there are more than three items in the list.\n * @internal\n */\n get hasMoreThanThreeItems() {\n return this._fileItems.length > 3;\n }\n\n override firstUpdated() {\n if (this.hasMoreThanThreeItems) {\n this._container.classList.add('shadow-bottom');\n this._addScrollListener();\n }\n }\n\n override render() {\n return html`\n <div class=\"file-uploader-list-container\">\n <div class=\"file-uploader-list-container__header\">\n ${this.titleText}\n <slot name=\"action-button\"></slot>\n </div>\n <div class=\"file-uploader-list-container__items\" tabindex=\"0\">\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n <!-- footer would go here, if needed. -->\n </div>\n `;\n }\n\n private _handleSlotChange() {\n if (this.hasMoreThanThreeItems) this._addScrollListener();\n else {\n setTimeout(() => {\n this._removeScrollListener();\n }, 20);\n }\n this.requestUpdate();\n }\n\n private _addScrollListener() {\n if (this._container) {\n this._scrollHandler = this._toggleShadowClass.bind(this, this._container);\n this._container.addEventListener('scroll', this._scrollHandler);\n this._container.classList.add('shadow-bottom');\n }\n }\n\n private _removeScrollListener() {\n if (this._container && this._scrollHandler) {\n this._container.removeEventListener('scroll', this._scrollHandler);\n this._container.classList.remove('shadow-bottom', 'shadow-top');\n }\n }\n\n private _toggleShadowClass(container: HTMLElement) {\n if (!container) return;\n\n const isAtTop = container.scrollTop === 0;\n const isAtBottom =\n container.scrollHeight - container.scrollTop === container.clientHeight;\n\n if (isAtTop) {\n setTimeout(() => {\n container.classList.add('shadow-bottom');\n container.classList.remove('shadow-top');\n }, 5);\n } else if (isAtBottom) {\n setTimeout(() => {\n container.classList.add('shadow-top');\n container.classList.remove('shadow-bottom');\n }, 5);\n }\n }\n\n /* \n ${hasMoreThanThreeItems\n ? html` <div class=\"file-uploader-list-container__footer\">\n <kyn-link\n standalone\n @on-click=${() => this._toggleReveal(!this._limitRevealed)}\n >${this._limitRevealed ? this.showLess : this.showAll}</kyn-link\n >\n </div>`\n : ''}\n */\n\n /*\n override firstUpdated() {\n this._applyLimit(true);\n }\n\n private _handleSlotChange() {\n this._applyLimit(this._limitRevealed);\n this.requestUpdate();\n }\n\n private _toggleReveal(reveal: boolean) {\n this._limitRevealed = reveal;\n this._applyLimit(reveal);\n }\n\n private _applyLimit(reveal: boolean) {\n const limit = 3;\n if (this._fileItems) {\n this._fileItems.forEach((item: any, index: number) => {\n if (index >= limit) {\n item.style.display = reveal ? 'block' : 'none';\n }\n });\n }\n }\n */\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-file-uploader-list-container': FileUploaderListContainer;\n }\n}\n"],"names":["FileUploaderListContainer","LitElement","constructor","this","titleText","_scrollHandler","hasMoreThanThreeItems","_fileItems","length","firstUpdated","_container","classList","add","_addScrollListener","render","html","_handleSlotChange","setTimeout","_removeScrollListener","requestUpdate","_toggleShadowClass","bind","addEventListener","removeEventListener","remove","container","isAtTop","scrollTop","isAtBottom","scrollHeight","clientHeight","styles","FileUploaderListContainerScss","__decorate","property","type","String","prototype","queryAssignedElements","query","state","customElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBO,IAAMA,EAAN,cAAwCC,EAAxC,WAAAC,uBAOLC,KAASC,UAAG,eAwCZD,KAAcE,eAAyB,IAmHxC,CA7GC,yBAAIC,GACF,OAAOH,KAAKI,WAAWC,OAAS,CACjC,CAEQ,YAAAC,GACHN,KAAKG,wBACPH,KAAKO,WAAWC,UAAUC,IAAI,iBAC9BT,KAAKU,qBAER,CAEQ,MAAAC,GACP,OAAOC,CAAI;;;YAGHZ,KAAKC;;;;8BAIaD,KAAKa;;;;KAKhC,CAEO,iBAAAA,GACFb,KAAKG,sBAAuBH,KAAKU,qBAEnCI,YAAW,KACTd,KAAKe,uBAAuB,GAC3B,IAELf,KAAKgB,eACN,CAEO,kBAAAN,GACFV,KAAKO,aACPP,KAAKE,eAAiBF,KAAKiB,mBAAmBC,KAAKlB,KAAMA,KAAKO,YAC9DP,KAAKO,WAAWY,iBAAiB,SAAUnB,KAAKE,gBAChDF,KAAKO,WAAWC,UAAUC,IAAI,iBAEjC,CAEO,qBAAAM,GACFf,KAAKO,YAAcP,KAAKE,iBAC1BF,KAAKO,WAAWa,oBAAoB,SAAUpB,KAAKE,gBACnDF,KAAKO,WAAWC,UAAUa,OAAO,gBAAiB,cAErD,CAEO,kBAAAJ,CAAmBK,GACzB,IAAKA,EAAW,OAEhB,MAAMC,EAAkC,IAAxBD,EAAUE,UACpBC,EACJH,EAAUI,aAAeJ,EAAUE,YAAcF,EAAUK,aAEzDJ,EACFT,YAAW,KACTQ,EAAUd,UAAUC,IAAI,iBACxBa,EAAUd,UAAUa,OAAO,aAAa,GACvC,GACMI,GACTX,YAAW,KACTQ,EAAUd,UAAUC,IAAI,cACxBa,EAAUd,UAAUa,OAAO,gBAAgB,GAC1C,EAEN,GAzHexB,EAAM+B,OAAGC,EAMzBC,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACSpC,EAAAqC,UAAA,iBAAA,GA0B3BJ,EAAA,CADCK,KACuBtC,EAAAqC,UAAA,kBAAA,GAOxBJ,EAAA,CADCM,EAAM,yCACkBvC,EAAAqC,UAAA,kBAAA,GAOzBJ,EAAA,CADCO,KAC2CxC,EAAAqC,UAAA,sBAAA,GA/CjCrC,EAAyBiC,EAAA,CADrCQ,EAAc,qCACFzC"}
1
+ {"version":3,"file":"fileUploaderListContainer.js","sources":["../../../../src/components/reusable/fileUploader/fileUploaderListContainer.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport {\n customElement,\n property,\n query,\n queryAssignedElements,\n state,\n} from 'lit/decorators.js';\nimport FileUploaderListContainerScss from './fileUploaderListContainer.scss';\nimport '../link';\n\n/**\n * File Uploader List Container\n * @slot unnamed - Slot for individual file uploader items.\n * @slot action-button - Slot for action button.\n */\n@customElement('kyn-file-uploader-list-container')\nexport class FileUploaderListContainer extends LitElement {\n static override styles = FileUploaderListContainerScss;\n\n /**\n * File details container title.\n */\n @property({ type: String })\n titleText = 'File details';\n\n /**\n * Show all text.\n */\n // @property({ type: String })\n // showAll = 'Show all files';\n\n /**\n * Show less text.\n */\n // @property({ type: String })\n // showLess = 'Show less files';\n\n /**\n * Limit visible file uploader items.\n * @internal\n */\n // @state()\n // _limitRevealed = false;\n\n /**\n * Queries for all slotted elements.\n * @internal\n */\n @queryAssignedElements()\n _fileItems!: Array<any>;\n\n /**\n * Queries for the items container element.\n * @internal\n */\n @query('.file-uploader-list-container__items')\n _container!: HTMLElement;\n\n /**\n * Scroll event handler.\n * @internal\n */\n @state()\n _scrollHandler: EventListener | null = null;\n\n /**\n * Checks if there are more than three items in the list.\n * @internal\n */\n get hasMoreThanThreeItems() {\n return this._fileItems.length > 3;\n }\n\n override firstUpdated() {\n if (this.hasMoreThanThreeItems) {\n this._container.classList.add('shadow-bottom');\n this._addScrollListener();\n }\n }\n\n override render() {\n return html`\n <div class=\"file-uploader-list-container\">\n <div class=\"file-uploader-list-container__header\">\n ${this.titleText}\n <slot name=\"action-button\"></slot>\n </div>\n <div class=\"file-uploader-list-container__items\" tabindex=\"0\">\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n <!-- footer would go here, if needed. -->\n </div>\n `;\n }\n\n private _handleSlotChange() {\n if (this.hasMoreThanThreeItems) this._addScrollListener();\n else {\n setTimeout(() => {\n this._removeScrollListener();\n }, 20);\n }\n this.requestUpdate();\n }\n\n private _addScrollListener() {\n if (this._container) {\n this._scrollHandler = this._toggleShadowClass.bind(this, this._container);\n this._container.addEventListener('scroll', this._scrollHandler);\n this._container.classList.add('shadow-bottom');\n }\n }\n\n private _removeScrollListener() {\n if (this._container && this._scrollHandler) {\n this._container.removeEventListener('scroll', this._scrollHandler);\n this._container.classList.remove('shadow-bottom', 'shadow-top');\n }\n }\n\n private _toggleShadowClass(container: HTMLElement) {\n if (!container) return;\n\n const isAtTop = container.scrollTop === 0;\n const isAtBottom =\n container.scrollHeight - container.scrollTop === container.clientHeight;\n\n if (isAtTop) {\n setTimeout(() => {\n container.classList.add('shadow-bottom');\n container.classList.remove('shadow-top');\n }, 5);\n } else if (isAtBottom) {\n setTimeout(() => {\n container.classList.add('shadow-top');\n container.classList.remove('shadow-bottom');\n }, 5);\n }\n }\n\n /* \n ${hasMoreThanThreeItems\n ? html` <div class=\"file-uploader-list-container__footer\">\n <kyn-link\n standalone\n @on-click=${() => this._toggleReveal(!this._limitRevealed)}\n >${this._limitRevealed ? this.showLess : this.showAll}</kyn-link\n >\n </div>`\n : ''}\n */\n\n /*\n override firstUpdated() {\n this._applyLimit(true);\n }\n\n private _handleSlotChange() {\n this._applyLimit(this._limitRevealed);\n this.requestUpdate();\n }\n\n private _toggleReveal(reveal: boolean) {\n this._limitRevealed = reveal;\n this._applyLimit(reveal);\n }\n\n private _applyLimit(reveal: boolean) {\n const limit = 3;\n if (this._fileItems) {\n this._fileItems.forEach((item: any, index: number) => {\n if (index >= limit) {\n item.style.display = reveal ? 'block' : 'none';\n }\n });\n }\n }\n */\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-file-uploader-list-container': FileUploaderListContainer;\n }\n}\n"],"names":["FileUploaderListContainer","LitElement","constructor","this","titleText","_scrollHandler","hasMoreThanThreeItems","_fileItems","length","firstUpdated","_container","classList","add","_addScrollListener","render","html","_handleSlotChange","setTimeout","_removeScrollListener","requestUpdate","_toggleShadowClass","bind","addEventListener","removeEventListener","remove","container","isAtTop","scrollTop","isAtBottom","scrollHeight","clientHeight","styles","FileUploaderListContainerScss","__decorate","property","type","String","prototype","queryAssignedElements","query","state","customElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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