@paperless/core 0.1.0-alpha.341 → 0.1.0-alpha.343

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 (55) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/build/{p-086cd638.entry.js → p-1b6cfd6c.entry.js} +2 -2
  3. package/dist/build/p-1b6cfd6c.entry.js.map +1 -0
  4. package/dist/build/{p-f1284018.entry.js → p-33f16166.entry.js} +2 -2
  5. package/dist/build/p-33f16166.entry.js.map +1 -0
  6. package/dist/build/p-b61128d4.entry.js +2 -0
  7. package/dist/build/p-b61128d4.entry.js.map +1 -0
  8. package/dist/build/paperless.esm.js +1 -1
  9. package/dist/cjs/p-select.cjs.entry.js +12 -1
  10. package/dist/cjs/p-select.cjs.entry.js.map +1 -1
  11. package/dist/cjs/p-stepper-item.cjs.entry.js +1 -1
  12. package/dist/cjs/p-stepper-item.cjs.entry.js.map +1 -1
  13. package/dist/cjs/p-stepper.cjs.entry.js +49 -30
  14. package/dist/cjs/p-stepper.cjs.entry.js.map +1 -1
  15. package/dist/collection/components/atoms/stepper-item/stepper-item.component.css +1 -1
  16. package/dist/collection/components/molecules/profile/profile.component.css +1 -1
  17. package/dist/collection/components/molecules/select/select.component.js +27 -0
  18. package/dist/collection/components/molecules/select/select.component.js.map +1 -1
  19. package/dist/collection/components/molecules/stepper/stepper.component.js +49 -30
  20. package/dist/collection/components/molecules/stepper/stepper.component.js.map +1 -1
  21. package/dist/components/p-select.js +12 -1
  22. package/dist/components/p-select.js.map +1 -1
  23. package/dist/components/p-stepper-item.js +1 -1
  24. package/dist/components/p-stepper-item.js.map +1 -1
  25. package/dist/components/p-stepper.js +49 -30
  26. package/dist/components/p-stepper.js.map +1 -1
  27. package/dist/esm/p-select.entry.js +12 -1
  28. package/dist/esm/p-select.entry.js.map +1 -1
  29. package/dist/esm/p-stepper-item.entry.js +1 -1
  30. package/dist/esm/p-stepper-item.entry.js.map +1 -1
  31. package/dist/esm/p-stepper.entry.js +49 -30
  32. package/dist/esm/p-stepper.entry.js.map +1 -1
  33. package/dist/index.html +1 -1
  34. package/dist/paperless/{p-086cd638.entry.js → p-1b6cfd6c.entry.js} +2 -2
  35. package/dist/paperless/p-1b6cfd6c.entry.js.map +1 -0
  36. package/dist/paperless/{p-f1284018.entry.js → p-33f16166.entry.js} +2 -2
  37. package/dist/paperless/p-33f16166.entry.js.map +1 -0
  38. package/dist/paperless/p-b61128d4.entry.js +2 -0
  39. package/dist/paperless/p-b61128d4.entry.js.map +1 -0
  40. package/dist/paperless/paperless.esm.js +1 -1
  41. package/dist/sw.js +1 -1
  42. package/dist/sw.js.map +1 -1
  43. package/dist/types/components/molecules/select/select.component.d.ts +5 -0
  44. package/dist/types/components/molecules/stepper/stepper.component.d.ts +1 -1
  45. package/dist/types/components.d.ts +4 -0
  46. package/hydrate/index.js +63 -33
  47. package/package.json +1 -1
  48. package/dist/build/p-086cd638.entry.js.map +0 -1
  49. package/dist/build/p-3a6e2934.entry.js +0 -2
  50. package/dist/build/p-3a6e2934.entry.js.map +0 -1
  51. package/dist/build/p-f1284018.entry.js.map +0 -1
  52. package/dist/paperless/p-086cd638.entry.js.map +0 -1
  53. package/dist/paperless/p-3a6e2934.entry.js +0 -2
  54. package/dist/paperless/p-3a6e2934.entry.js.map +0 -1
  55. package/dist/paperless/p-f1284018.entry.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,34 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.1.0-alpha.343](https://github.com/ionic-team/stencil-component-starter/compare/v0.1.0-alpha.342...v0.1.0-alpha.343) (2023-02-21)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **Atoms/Stepper Item:** Fix semibold font ([47e0c4f](https://github.com/ionic-team/stencil-component-starter/commit/47e0c4f7a7cf1a3a3a066bae39f9da6426c23126))
12
+
13
+
14
+ ### Features
15
+
16
+ * **Molecules/Select:** Don't show dropdown when no items & Add dropdown shown event ([bfa8857](https://github.com/ionic-team/stencil-component-starter/commit/bfa8857a521d20d1193ea479b79e5058fdb76ffb))
17
+ * **Molecules/Stepper:** Automatically set activeIndex based on items ([4f5dac6](https://github.com/ionic-team/stencil-component-starter/commit/4f5dac6b652dc8ffc6c634f354bcaeb0004eb083))
18
+
19
+
20
+
21
+
22
+
23
+ # [0.1.0-alpha.342](https://github.com/ionic-team/stencil-component-starter/compare/v0.1.0-alpha.341...v0.1.0-alpha.342) (2023-02-21)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **Molecules/Stepper:** Update properties on re-render/changes ([0339656](https://github.com/ionic-team/stencil-component-starter/commit/033965609199a5dc5f992b24130f2b687c9ea4af))
29
+
30
+
31
+
32
+
33
+
6
34
  # [0.1.0-alpha.341](https://github.com/ionic-team/stencil-component-starter/compare/v0.1.0-alpha.340...v0.1.0-alpha.341) (2023-02-21)
7
35
 
8
36
 
@@ -1,2 +1,2 @@
1
- import{r as t,h as r,H as a}from"./p-69d43b9d.js";const e=".static{position:static!important}.absolute{position:absolute!important}.relative{position:relative!important}.left-1{left:.25rem!important}.order-2{order:2!important}.ml-0{margin-left:0!important}.mr-4{margin-right:1rem!important}.flex{display:flex!important}.h-4{height:1rem!important}.w-4{width:1rem!important}.min-w-0{min-width:0!important}.-translate-x-1{--tw-translate-x:-0.25rem!important}.-rotate-0,.-translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-0{--tw-rotate:-0deg!important}.-rotate-135{--tw-rotate:-135deg!important}.-rotate-135,.-rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-180{--tw-rotate:-180deg!important}.-rotate-225{--tw-rotate:-225deg!important}.-rotate-225,.-rotate-25{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-25{--tw-rotate:-25deg!important}.-rotate-270{--tw-rotate:-270deg!important}.-rotate-270,.-rotate-315{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-315{--tw-rotate:-315deg!important}.-rotate-45{--tw-rotate:-45deg!important}.-rotate-45,.-rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-90{--tw-rotate:-90deg!important}.rotate-0{--tw-rotate:0deg!important}.rotate-0,.rotate-135{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-135{--tw-rotate:135deg!important}.rotate-180{--tw-rotate:180deg!important}.rotate-180,.rotate-225{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-225{--tw-rotate:225deg!important}.rotate-25{--tw-rotate:25deg!important}.rotate-25,.rotate-270{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-270{--tw-rotate:270deg!important}.rotate-315{--tw-rotate:315deg!important}.rotate-315,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-45{--tw-rotate:45deg!important}.rotate-90{--tw-rotate:90deg!important}.rotate-90,.scale-x-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.scale-x-flip{--tw-scale-x:-1!important}.scale-y-flip{--tw-scale-y:-1!important}.scale-y-flip,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.bg-mystic-dark{--tw-bg-opacity:1!important;background-color:rgb(218 230 240/var(--tw-bg-opacity))!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important}.text-5xl,.text-6xl{line-height:1!important}.text-6xl{font-size:3.75rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.text-xxs{font-size:.6875rem!important}.font-semibold{font-weight:600!important}.transition{transition-duration:.15s!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.duration-500{transition-duration:.5s!important}*{box-sizing:border-box}.left-1\\/2{left:50%!important}.min-h-\\[1rem\\]{min-height:1rem!important}.-translate-x-1\\/2{--tw-translate-x:-50%!important}.-translate-x-1\\/2,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}:host{align-items:flex-end;display:flex;justify-content:center;position:relative}:host .content{--tw-text-opacity:1;color:rgb(176 178 203/var(--tw-text-opacity));font-size:.875rem;font-weight:600;line-height:1.25rem;min-width:0;white-space:nowrap}:host .circle{--tw-bg-opacity:1;--tw-text-opacity:1;align-items:center;background-color:rgb(218 230 240/var(--tw-bg-opacity));border-radius:100%;color:rgb(255 255 255/var(--tw-text-opacity));display:flex;height:1rem;justify-content:center;transition-duration:.5s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);width:1rem}:host .circle p-icon{display:flex!important;font-size:.625rem}:host([direction=horizontal]){height:2.5rem}:host([direction=horizontal]) .content{order:1;position:absolute;top:0}:host([direction=horizontal]) .circle{order:2}:host([direction=vertical]){align-items:center;min-height:1rem}:host([direction=vertical]) .content{margin-left:1rem;order:2}:host([direction=vertical]) .circle{order:1}:host([active]) .content,:host([finished]) .content{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}:host([active]) .circle,:host([finished]) .circle{--tw-bg-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity))}:host([direction=horizontal][align=start]) .content{left:0}:host([direction=horizontal][align=end]) .content{right:0}:host([direction=horizontal][align=center]) .content{--tw-translate-x:-50%;left:50%;text-align:center;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host([direction=vertical][content-position=start]){flex-direction:row-reverse}:host([direction=vertical][content-position=start]) .content{display:flex;justify-content:flex-end;margin-left:0;margin-right:1rem}.-rotate-0,.-rotate-135,.-rotate-180,.-rotate-225,.-rotate-25,.-rotate-270,.-rotate-315,.-rotate-45,.-rotate-90,.rotate-0,.rotate-135,.rotate-180,.rotate-225,.rotate-25,.rotate-270,.rotate-315,.rotate-45,.rotate-90,.scale-x-flip,.scale-y-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.text-lg,.text-xl{line-height:1.75rem!important}.-rotate-0,.-rotate-135,.-rotate-180,.-rotate-225,.-rotate-25,.-rotate-270,.-rotate-315,.-rotate-45,.-rotate-90,.rotate-0,.rotate-135,.rotate-180,.rotate-225,.rotate-25,.rotate-270,.rotate-315,.rotate-45,.rotate-90,.scale-x-flip,.scale-y-flip,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}";const o=class{constructor(r){t(this,r);this.align="center";this.direction="horizontal";this.contentPosition="end";this.finished=false;this.active=false}render(){return r(a,{class:"p-stepper-item"},r("div",{class:"content"},r("slot",{name:"content"})),r("div",{class:"circle"},this.finished&&r("p-icon",{variant:"checkmark"})))}};o.style=e;export{o as p_stepper_item};
2
- //# sourceMappingURL=p-086cd638.entry.js.map
1
+ import{r as t,h as r,H as a}from"./p-69d43b9d.js";const e=".static{position:static!important}.absolute{position:absolute!important}.relative{position:relative!important}.left-1{left:.25rem!important}.order-2{order:2!important}.ml-0{margin-left:0!important}.mr-4{margin-right:1rem!important}.flex{display:flex!important}.h-4{height:1rem!important}.w-4{width:1rem!important}.min-w-0{min-width:0!important}.-translate-x-1{--tw-translate-x:-0.25rem!important}.-rotate-0,.-translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-0{--tw-rotate:-0deg!important}.-rotate-135{--tw-rotate:-135deg!important}.-rotate-135,.-rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-180{--tw-rotate:-180deg!important}.-rotate-225{--tw-rotate:-225deg!important}.-rotate-225,.-rotate-25{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-25{--tw-rotate:-25deg!important}.-rotate-270{--tw-rotate:-270deg!important}.-rotate-270,.-rotate-315{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-315{--tw-rotate:-315deg!important}.-rotate-45{--tw-rotate:-45deg!important}.-rotate-45,.-rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-90{--tw-rotate:-90deg!important}.rotate-0{--tw-rotate:0deg!important}.rotate-0,.rotate-135{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-135{--tw-rotate:135deg!important}.rotate-180{--tw-rotate:180deg!important}.rotate-180,.rotate-225{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-225{--tw-rotate:225deg!important}.rotate-25{--tw-rotate:25deg!important}.rotate-25,.rotate-270{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-270{--tw-rotate:270deg!important}.rotate-315{--tw-rotate:315deg!important}.rotate-315,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-45{--tw-rotate:45deg!important}.rotate-90{--tw-rotate:90deg!important}.rotate-90,.scale-x-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.scale-x-flip{--tw-scale-x:-1!important}.scale-y-flip{--tw-scale-y:-1!important}.scale-y-flip,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.bg-mystic-dark{--tw-bg-opacity:1!important;background-color:rgb(218 230 240/var(--tw-bg-opacity))!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important}.text-5xl,.text-6xl{line-height:1!important}.text-6xl{font-size:3.75rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.text-xxs{font-size:.6875rem!important}.transition{transition-duration:.15s!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.duration-500{transition-duration:.5s!important}*{box-sizing:border-box}.left-1\\/2{left:50%!important}.min-h-\\[1rem\\]{min-height:1rem!important}.-translate-x-1\\/2{--tw-translate-x:-50%!important}.-translate-x-1\\/2,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}:host{align-items:flex-end;display:flex;justify-content:center;position:relative}:host .content{--tw-text-opacity:1;color:rgb(176 178 203/var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem;min-width:0;white-space:nowrap}:host .circle{--tw-bg-opacity:1;--tw-text-opacity:1;align-items:center;background-color:rgb(218 230 240/var(--tw-bg-opacity));border-radius:100%;color:rgb(255 255 255/var(--tw-text-opacity));display:flex;height:1rem;justify-content:center;transition-duration:.5s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);width:1rem}:host .circle p-icon{display:flex!important;font-size:.625rem}:host([direction=horizontal]){height:2.5rem}:host([direction=horizontal]) .content{order:1;position:absolute;top:0}:host([direction=horizontal]) .circle{order:2}:host([direction=vertical]){align-items:center;min-height:1rem}:host([direction=vertical]) .content{margin-left:1rem;order:2}:host([direction=vertical]) .circle{order:1}:host([active]) .content,:host([finished]) .content{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}:host([active]) .circle,:host([finished]) .circle{--tw-bg-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity))}:host([direction=horizontal][align=start]) .content{left:0}:host([direction=horizontal][align=end]) .content{right:0}:host([direction=horizontal][align=center]) .content{--tw-translate-x:-50%;left:50%;text-align:center;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host([direction=vertical][content-position=start]){flex-direction:row-reverse}:host([direction=vertical][content-position=start]) .content{display:flex;justify-content:flex-end;margin-left:0;margin-right:1rem}.-rotate-0,.-rotate-135,.-rotate-180,.-rotate-225,.-rotate-25,.-rotate-270,.-rotate-315,.-rotate-45,.-rotate-90,.rotate-0,.rotate-135,.rotate-180,.rotate-225,.rotate-25,.rotate-270,.rotate-315,.rotate-45,.rotate-90,.scale-x-flip,.scale-y-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.text-lg,.text-xl{line-height:1.75rem!important}.-rotate-0,.-rotate-135,.-rotate-180,.-rotate-225,.-rotate-25,.-rotate-270,.-rotate-315,.-rotate-45,.-rotate-90,.rotate-0,.rotate-135,.rotate-180,.rotate-225,.rotate-25,.rotate-270,.rotate-315,.rotate-45,.rotate-90,.scale-x-flip,.scale-y-flip,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}";const o=class{constructor(r){t(this,r);this.align="center";this.direction="horizontal";this.contentPosition="end";this.finished=false;this.active=false}render(){return r(a,{class:"p-stepper-item"},r("div",{class:"content"},r("slot",{name:"content"})),r("div",{class:"circle"},this.finished&&r("p-icon",{variant:"checkmark"})))}};o.style=e;export{o as p_stepper_item};
2
+ //# sourceMappingURL=p-1b6cfd6c.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stepperItemComponentCss","StepperItem","render","h","Host","class","name","this","finished","variant"],"sources":["./src/components/atoms/stepper-item/stepper-item.component.scss?tag=p-stepper-item&encapsulation=shadow","./src/components/atoms/stepper-item/stepper-item.component.tsx"],"sourcesContent":[":host {\n @apply relative flex items-end justify-center;\n\n .content {\n @apply min-w-0 whitespace-nowrap;\n @apply text-sm text-storm-light;\n }\n\n .circle {\n @apply transition duration-500 ease-in-out;\n @apply flex items-center justify-center;\n @apply h-4 w-4 rounded-round;\n @apply bg-mystic-dark text-white;\n\n p-icon {\n @apply flex #{!important};\n font-size: 0.625rem;\n }\n }\n}\n\n:host([direction='horizontal']) {\n @apply h-10;\n\n .content {\n @apply absolute top-0;\n @apply order-1;\n }\n\n .circle {\n @apply order-2;\n }\n}\n\n:host([direction='vertical']) {\n @apply min-h-[1rem] items-center;\n\n .content {\n @apply order-2 ml-4;\n }\n\n .circle {\n @apply order-1;\n }\n}\n\n:host([active]),\n:host([finished]) {\n .content {\n @apply text-indigo;\n }\n\n .circle {\n @apply bg-indigo;\n }\n}\n\n:host([direction='horizontal'][align='start']) {\n .content {\n @apply left-0;\n }\n}\n\n:host([direction='horizontal'][align='end']) {\n .content {\n @apply right-0;\n }\n}\n\n:host([direction='horizontal'][align='center']) {\n .content {\n @apply left-1/2 -translate-x-1/2 transform text-center;\n }\n}\n\n:host([direction='vertical'][content-position='start']) {\n @apply flex-row-reverse;\n\n .content {\n @apply ml-0 mr-4 flex justify-end;\n }\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'p-stepper-item',\n styleUrl: 'stepper-item.component.scss',\n shadow: true,\n})\nexport class StepperItem {\n /**\n * The alignment of the step content\n */\n @Prop({ reflect: true }) align: 'start' | 'center' | 'end' = 'center';\n\n /**\n * The direction of the stepper step\n */\n @Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n 'horizontal';\n\n /**\n * The position of the content in case of vertical direction\n */\n @Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n /**\n * Wether the step is finished\n */\n @Prop({ reflect: true }) finished: boolean = false;\n\n /**\n * Wether the step is active\n */\n @Prop({ reflect: true }) active: boolean = false;\n\n render() {\n return (\n <Host class=\"p-stepper-item\">\n <div class=\"content\">\n <slot name=\"content\" />\n </div>\n <div class=\"circle\">\n {this.finished && <p-icon variant=\"checkmark\" />}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAA0B,gmR,MCOnBC,EAAW,M,oCAIyC,S,eAMzD,a,qBAKwD,M,cAKf,M,YAKF,K,CAE3CC,SACI,OACIC,EAACC,EAAI,CAACC,MAAM,kBACRF,EAAA,OAAKE,MAAM,WACPF,EAAA,QAAMG,KAAK,aAEfH,EAAA,OAAKE,MAAM,UACNE,KAAKC,UAAYL,EAAA,UAAQM,QAAQ,e"}
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,h as r,H as a,g as i}from"./p-69d43b9d.js";import{c as s}from"./p-8a6728d5.js";const o=".visible{visibility:visible!important}.static{position:static!important}.absolute{position:absolute!important}.ml-2{margin-left:.5rem!important}.inline{display:inline!important}.flex{display:flex!important}.h-6{height:1.5rem!important}.w-full{width:100%!important}.-rotate-0{--tw-rotate:-0deg!important}.-rotate-0,.-rotate-135{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-135{--tw-rotate:-135deg!important}.-rotate-180{--tw-rotate:-180deg!important}.-rotate-180,.-rotate-225{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-225{--tw-rotate:-225deg!important}.-rotate-25{--tw-rotate:-25deg!important}.-rotate-25,.-rotate-270{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-270{--tw-rotate:-270deg!important}.-rotate-315{--tw-rotate:-315deg!important}.-rotate-315,.-rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-45{--tw-rotate:-45deg!important}.-rotate-90{--tw-rotate:-90deg!important}.-rotate-90,.rotate-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-0{--tw-rotate:0deg!important}.rotate-135{--tw-rotate:135deg!important}.rotate-135,.rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-180{--tw-rotate:180deg!important}.rotate-225{--tw-rotate:225deg!important}.rotate-225,.rotate-25{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-25{--tw-rotate:25deg!important}.rotate-270{--tw-rotate:270deg!important}.rotate-270,.rotate-315{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-315{--tw-rotate:315deg!important}.rotate-45{--tw-rotate:45deg!important}.rotate-45,.rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-90{--tw-rotate:90deg!important}.scale-x-flip{--tw-scale-x:-1!important}.scale-x-flip,.scale-y-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.scale-y-flip{--tw-scale-y:-1!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cursor-pointer{cursor:pointer!important}.items-end{align-items:flex-end!important}.justify-center{justify-content:center!important}.justify-between{justify-content:space-between!important}.rounded{border-radius:.25rem!important}.rounded-bl-none{border-bottom-left-radius:0!important}.rounded-br-none{border-bottom-right-radius:0!important}.rounded-tl-none{border-top-left-radius:0!important}.rounded-tr-none{border-top-right-radius:0!important}.border-l-0{border-left-width:0!important}.border-r-0{border-right-width:0!important}.pl-0{padding-left:0!important}.pr-0{padding-right:0!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important}.text-5xl,.text-6xl{line-height:1!important}.text-6xl{font-size:3.75rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.text-xxs{font-size:.6875rem!important}.text-negative{color:rgb(185 30 40/var(--tw-text-opacity))!important}.text-negative,.text-negative-light{--tw-text-opacity:1!important}.text-negative-light{color:rgb(255 204 211/var(--tw-text-opacity))!important}.blur{--tw-blur:blur(8px)!important}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}*{box-sizing:border-box}:host{display:flex;flex-direction:column}:host input.read-only{text-overflow:ellipsis}.-rotate-0,.-rotate-135,.-rotate-180,.-rotate-225,.-rotate-25,.-rotate-270,.-rotate-315,.-rotate-45,.-rotate-90,.rotate-0,.rotate-135,.rotate-180,.rotate-225,.rotate-25,.rotate-270,.rotate-315,.rotate-45,.rotate-90,.scale-x-flip,.scale-y-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.hover\\:text-negative:hover{--tw-text-opacity:1!important;color:rgb(185 30 40/var(--tw-text-opacity))!important}";const n=class{constructor(r){t(this,r);this.queryChange=e(this,"queryChange",7);this.valueChange=e(this,"valueChange",7);this._isAutoCompleting=false;this.items=undefined;this.icon=undefined;this.query=undefined;this.placeholder=undefined;this.autocompletePlaceholder=undefined;this.value=undefined;this.displayKey="text";this.valueKey="value";this.queryKey=undefined;this.autoSelectFirst=true;this.showChevron=true;this.maxDisplayedItems=10;this.enableAutocomplete=true;this.asyncFilter=false;this.loading=false;this.size="medium";this.prefix=undefined;this.label=undefined;this.helper=undefined;this.error=undefined;this.disabled=false;this._showDropdown=false;this._selectedItem=null}get _items(){var t;if(!this.items||this.loading){return[]}let e=typeof this.items==="string"?JSON.parse(this.items):this.items;if(typeof(e===null||e===void 0?void 0:e[0])==="string"){this.displayKey="text";this.valueKey="value";e=e.map((t=>({value:t,text:t})))}if(this._isAutoCompleting&&((t=this.query)===null||t===void 0?void 0:t.length)&&!this.asyncFilter){e=e.filter((t=>{if(this.queryKey){return this._checkvalue(this.queryKey,t)}return this._checkvalue(this.valueKey,t)||this._checkvalue(this.displayKey,t)}))}return e===null||e===void 0?void 0:e.slice(0,this.maxDisplayedItems)}get _displayValue(){var t;if(this._isAutoCompleting){return this.query}return(t=this._selectedItem)===null||t===void 0?void 0:t[this.displayKey]}get _placeholder(){var t;return this._isAutoCompleting&&((t=this.autocompletePlaceholder)===null||t===void 0?void 0:t.length)?this.autocompletePlaceholder:this.placeholder}componentDidLoad(){var t;if(this.value){this._valueChange(this.value);return}if(this.autoSelectFirst){this._selectedItem=(t=this._items)===null||t===void 0?void 0:t[0]}}render(){return r(a,{class:"p-select"},r("p-dropdown",{disableTriggerClick:true,calculateWidth:true,insideClick:true,show:this._showDropdown},r("p-input-group",{slot:"trigger",icon:this.icon,size:this.size,prefix:this.prefix,label:this.label,helper:this.helper,error:this.error,disabled:this.disabled,focused:this._showDropdown},r("input",{slot:"input",type:"text",placeholder:this._placeholder,value:this._displayValue,class:`p-input cursor-pointer ${!this._isAutoCompleting&&"read-only"}`,onFocus:()=>this._onFocus(),onMouseDown:t=>this._onMouseDown(t),onClick:()=>this._onClick(),onInput:t=>this._onChange(t),ref:t=>this._inputRef=t}),this.showChevron&&r("p-icon",{variant:"chevron",slot:"suffix"})),r("div",{slot:"items"},this.loading?this._getLoadingItems():this._getItems())))}documentClickHandler({target:t}){if(!this._showDropdown||s(t,this._el)){return}this._showDropdown=false;this._isAutoCompleting=false}_valueChange(t){this._preselectItem(t)}itemChanges(){this._preselectItem()}_preselectItem(t){t=t===undefined?null:t;const e=!!this.value?JSON.stringify(this.value):JSON.stringify(t);if(this._selectedItem&&JSON.stringify(this._selectedItem[this.valueKey])===e){return}const r=this._items.find((t=>JSON.stringify(t===null||t===void 0?void 0:t[this.valueKey])===e));this._selectedItem=r}_selectValue(t){this._selectedItem=t;const e=t[this.valueKey];this.value=e;this.valueChange.emit(this.value);this._onBlur(true)}_onFocus(){if(!this.enableAutocomplete){this._inputRef.blur();if(!this._showDropdown){this._showDropdown=true}return}this._isAutoCompleting=true;this._showDropdown=true}_onMouseDown(t){if(this.enableAutocomplete){return}t.preventDefault()}_onClick(){if(this.enableAutocomplete){return}this._showDropdown=!this._showDropdown}_onBlur(t=false){if(!this.enableAutocomplete&&!t){return}this._isAutoCompleting=false;this._showDropdown=false}_onChange(t){if(!this._isAutoCompleting){return}this.query=t.target.value;this.queryChange.emit(this.query)}_checkvalue(t,e){var r,a,i;return((a=(r=e===null||e===void 0?void 0:e[t])===null||r===void 0?void 0:r.toString())===null||a===void 0?void 0:a.toLowerCase().indexOf((i=this.query)===null||i===void 0?void 0:i.toLowerCase()))>=0}_getItems(){return this._items.map((t=>{var e;return r("p-dropdown-menu-item",{onClick:()=>this._selectValue(t),active:t[this.valueKey]===((e=this._selectedItem)===null||e===void 0?void 0:e[this.valueKey])},t[this.displayKey])}))}_getLoadingItems(){return[0,0,0].map((()=>r("p-dropdown-menu-item",{enableHover:false},r("p-loader",{variant:"ghost",class:"h-6 w-full rounded"}))))}get _el(){return i(this)}static get watchers(){return{value:["_valueChange"],items:["itemChanges"]}}};n.style=o;export{n as p_select};
2
- //# sourceMappingURL=p-f1284018.entry.js.map
1
+ import{r as t,c as e,h as r,H as a,g as i}from"./p-69d43b9d.js";import{c as s}from"./p-8a6728d5.js";const o=".visible{visibility:visible!important}.static{position:static!important}.absolute{position:absolute!important}.ml-2{margin-left:.5rem!important}.inline{display:inline!important}.flex{display:flex!important}.h-6{height:1.5rem!important}.w-full{width:100%!important}.-rotate-0{--tw-rotate:-0deg!important}.-rotate-0,.-rotate-135{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-135{--tw-rotate:-135deg!important}.-rotate-180{--tw-rotate:-180deg!important}.-rotate-180,.-rotate-225{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-225{--tw-rotate:-225deg!important}.-rotate-25{--tw-rotate:-25deg!important}.-rotate-25,.-rotate-270{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-270{--tw-rotate:-270deg!important}.-rotate-315{--tw-rotate:-315deg!important}.-rotate-315,.-rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-45{--tw-rotate:-45deg!important}.-rotate-90{--tw-rotate:-90deg!important}.-rotate-90,.rotate-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-0{--tw-rotate:0deg!important}.rotate-135{--tw-rotate:135deg!important}.rotate-135,.rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-180{--tw-rotate:180deg!important}.rotate-225{--tw-rotate:225deg!important}.rotate-225,.rotate-25{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-25{--tw-rotate:25deg!important}.rotate-270{--tw-rotate:270deg!important}.rotate-270,.rotate-315{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-315{--tw-rotate:315deg!important}.rotate-45{--tw-rotate:45deg!important}.rotate-45,.rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-90{--tw-rotate:90deg!important}.scale-x-flip{--tw-scale-x:-1!important}.scale-x-flip,.scale-y-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.scale-y-flip{--tw-scale-y:-1!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cursor-pointer{cursor:pointer!important}.items-end{align-items:flex-end!important}.justify-center{justify-content:center!important}.justify-between{justify-content:space-between!important}.rounded{border-radius:.25rem!important}.rounded-bl-none{border-bottom-left-radius:0!important}.rounded-br-none{border-bottom-right-radius:0!important}.rounded-tl-none{border-top-left-radius:0!important}.rounded-tr-none{border-top-right-radius:0!important}.border-l-0{border-left-width:0!important}.border-r-0{border-right-width:0!important}.pl-0{padding-left:0!important}.pr-0{padding-right:0!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important}.text-5xl,.text-6xl{line-height:1!important}.text-6xl{font-size:3.75rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.text-xxs{font-size:.6875rem!important}.text-negative{color:rgb(185 30 40/var(--tw-text-opacity))!important}.text-negative,.text-negative-light{--tw-text-opacity:1!important}.text-negative-light{color:rgb(255 204 211/var(--tw-text-opacity))!important}.blur{--tw-blur:blur(8px)!important}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}*{box-sizing:border-box}:host{display:flex;flex-direction:column}:host input.read-only{text-overflow:ellipsis}.-rotate-0,.-rotate-135,.-rotate-180,.-rotate-225,.-rotate-25,.-rotate-270,.-rotate-315,.-rotate-45,.-rotate-90,.rotate-0,.rotate-135,.rotate-180,.rotate-225,.rotate-25,.rotate-270,.rotate-315,.rotate-45,.rotate-90,.scale-x-flip,.scale-y-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.hover\\:text-negative:hover{--tw-text-opacity:1!important;color:rgb(185 30 40/var(--tw-text-opacity))!important}";const n=class{constructor(r){t(this,r);this.queryChange=e(this,"queryChange",7);this.valueChange=e(this,"valueChange",7);this.dropdownShown=e(this,"dropdownShown",7);this._isAutoCompleting=false;this.items=undefined;this.icon=undefined;this.query=undefined;this.placeholder=undefined;this.autocompletePlaceholder=undefined;this.value=undefined;this.displayKey="text";this.valueKey="value";this.queryKey=undefined;this.autoSelectFirst=true;this.showChevron=true;this.maxDisplayedItems=10;this.enableAutocomplete=true;this.asyncFilter=false;this.loading=false;this.size="medium";this.prefix=undefined;this.label=undefined;this.helper=undefined;this.error=undefined;this.disabled=false;this._showDropdown=false;this._selectedItem=null}get _items(){var t;if(!this.items||this.loading){return[]}let e=typeof this.items==="string"?JSON.parse(this.items):this.items;if(typeof(e===null||e===void 0?void 0:e[0])==="string"){this.displayKey="text";this.valueKey="value";e=e.map((t=>({value:t,text:t})))}if(this._isAutoCompleting&&((t=this.query)===null||t===void 0?void 0:t.length)&&!this.asyncFilter){e=e.filter((t=>{if(this.queryKey){return this._checkvalue(this.queryKey,t)}return this._checkvalue(this.valueKey,t)||this._checkvalue(this.displayKey,t)}))}return e===null||e===void 0?void 0:e.slice(0,this.maxDisplayedItems)}get _displayValue(){var t;if(this._isAutoCompleting){return this.query}return(t=this._selectedItem)===null||t===void 0?void 0:t[this.displayKey]}get _placeholder(){var t;return this._isAutoCompleting&&((t=this.autocompletePlaceholder)===null||t===void 0?void 0:t.length)?this.autocompletePlaceholder:this.placeholder}componentDidLoad(){var t;if(this.value){this._valueChange(this.value);return}if(this.autoSelectFirst){this._selectedItem=(t=this._items)===null||t===void 0?void 0:t[0]}}render(){return r(a,{class:"p-select"},r("p-dropdown",{disableTriggerClick:true,calculateWidth:true,insideClick:true,show:this._showDropdown},r("p-input-group",{slot:"trigger",icon:this.icon,size:this.size,prefix:this.prefix,label:this.label,helper:this.helper,error:this.error,disabled:this.disabled,focused:this._showDropdown},r("input",{slot:"input",type:"text",placeholder:this._placeholder,value:this._displayValue,class:`p-input cursor-pointer ${!this._isAutoCompleting&&"read-only"}`,onFocus:()=>this._onFocus(),onMouseDown:t=>this._onMouseDown(t),onClick:()=>this._onClick(),onInput:t=>this._onChange(t),ref:t=>this._inputRef=t}),this.showChevron&&r("p-icon",{variant:"chevron",slot:"suffix"})),r("div",{slot:"items"},this.loading?this._getLoadingItems():this._getItems())))}documentClickHandler({target:t}){if(!this._showDropdown||s(t,this._el)){return}this._showDropdown=false;this._isAutoCompleting=false}_valueChange(t){this._preselectItem(t)}itemChanges(){this._preselectItem()}_showDropdownChanges(){this.dropdownShown.emit({value:this._showDropdown,query:this.query})}_preselectItem(t){t=t===undefined?null:t;const e=!!this.value?JSON.stringify(this.value):JSON.stringify(t);if(this._selectedItem&&JSON.stringify(this._selectedItem[this.valueKey])===e){return}const r=this._items.find((t=>JSON.stringify(t===null||t===void 0?void 0:t[this.valueKey])===e));this._selectedItem=r}_selectValue(t){this._selectedItem=t;const e=t[this.valueKey];this.value=e;this.valueChange.emit(this.value);this._onBlur(true)}_onFocus(){if(!this.items.length&&!this.loading){return}if(!this.enableAutocomplete){this._inputRef.blur();if(!this._showDropdown){this._showDropdown=true}return}this._isAutoCompleting=true;this._showDropdown=true}_onMouseDown(t){if(this.enableAutocomplete){return}t.preventDefault()}_onClick(){if(this.enableAutocomplete){return}this._showDropdown=!this._showDropdown}_onBlur(t=false){if(!this.enableAutocomplete&&!t){return}this._isAutoCompleting=false;this._showDropdown=false}_onChange(t){if(!this._isAutoCompleting){return}this.query=t.target.value;this.queryChange.emit(this.query)}_checkvalue(t,e){var r,a,i;return((a=(r=e===null||e===void 0?void 0:e[t])===null||r===void 0?void 0:r.toString())===null||a===void 0?void 0:a.toLowerCase().indexOf((i=this.query)===null||i===void 0?void 0:i.toLowerCase()))>=0}_getItems(){return this._items.map((t=>{var e;return r("p-dropdown-menu-item",{onClick:()=>this._selectValue(t),active:t[this.valueKey]===((e=this._selectedItem)===null||e===void 0?void 0:e[this.valueKey])},t[this.displayKey])}))}_getLoadingItems(){return[0,0,0].map((()=>r("p-dropdown-menu-item",{enableHover:false},r("p-loader",{variant:"ghost",class:"h-6 w-full rounded"}))))}get _el(){return i(this)}static get watchers(){return{value:["_valueChange"],items:["itemChanges"],_showDropdown:["_showDropdownChanges"]}}};n.style=o;export{n as p_select};
2
+ //# sourceMappingURL=p-33f16166.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["selectComponentCss","Select","this","_isAutoCompleting","_items","items","loading","JSON","parse","displayKey","valueKey","map","str","value","text","_a","query","length","asyncFilter","filter","item","queryKey","_checkvalue","slice","maxDisplayedItems","_displayValue","_selectedItem","_placeholder","autocompletePlaceholder","placeholder","componentDidLoad","_valueChange","autoSelectFirst","render","h","Host","class","disableTriggerClick","calculateWidth","insideClick","show","_showDropdown","slot","icon","size","prefix","label","helper","error","disabled","focused","type","onFocus","_onFocus","onMouseDown","ev","_onMouseDown","onClick","_onClick","onInput","_onChange","ref","_inputRef","showChevron","variant","_getLoadingItems","_getItems","documentClickHandler","target","childOf","_el","_preselectItem","itemChanges","_showDropdownChanges","dropdownShown","emit","undefined","parsedValue","stringify","find","i","_selectValue","valueChange","_onBlur","enableAutocomplete","blur","preventDefault","force","queryChange","key","_b","toString","toLowerCase","indexOf","_c","active","enableHover"],"sources":["./src/components/molecules/select/select.component.scss?tag=p-select","./src/components/molecules/select/select.component.tsx"],"sourcesContent":[":host {\n @apply flex flex-col;\n\n input.read-only {\n @apply text-ellipsis;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\n\n@Component({\n tag: 'p-select',\n styleUrl: 'select.component.scss',\n shadow: false,\n})\nexport class Select {\n /**\n * The items to show in the dropdown\n */\n @Prop() items: string | any[];\n\n /**\n * Icon of the select box\n */\n @Prop() icon: IconVariant;\n\n /**\n * The current query\n */\n @Prop() query: string;\n\n /**\n * The placeholder of the input\n */\n @Prop() placeholder: string;\n\n /**\n * The placeholder of the input when auto completing\n */\n @Prop() autocompletePlaceholder: string;\n\n /**\n * The current value\n */\n @Prop() value: any;\n\n /**\n * The key of the object to display\n */\n @Prop() displayKey: string = 'text';\n\n /**\n * The key of the object to return\n */\n @Prop() valueKey: string = 'value';\n\n /**\n * The key of the object to display\n */\n @Prop() queryKey?: string;\n\n /**\n * Wether to automatically select the first item\n */\n @Prop() autoSelectFirst: boolean = true;\n\n /**\n * Wether to show the chevron or not\n */\n @Prop() showChevron: boolean = true;\n\n /**\n * The maximum amount of items to display\n */\n @Prop() maxDisplayedItems: number = 10;\n\n /**\n * Wether to enable autocomplete\n */\n @Prop() enableAutocomplete: boolean = true;\n\n /**\n * Wether the input uses async filtering\n */\n @Prop() asyncFilter: boolean = false;\n\n /**\n * Wether to show loading items\n */\n @Prop() loading: boolean = false;\n\n /**\n * Event when the query of the autocomplete changes\n */\n @Event() queryChange: EventEmitter<string>;\n\n /**\n * Event when the value changes\n */\n @Event() valueChange: EventEmitter<any>;\n\n /**\n * Event when the dropdown shows\n */\n @Event() dropdownShown: EventEmitter<any>;\n\n /**\n * The size of the input group used by the select\n */\n @Prop() size: 'small' | 'medium' = 'medium';\n\n /**\n * The prefix of the input group used by the select\n */\n @Prop() prefix: string;\n\n /**\n * The label of the input group used by the select\n */\n @Prop() label: string;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop() helper: string;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop({ reflect: true }) error: string;\n\n /**\n * Wether the input group is disabled used by the select\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n @State() private _showDropdown: any = false;\n @State() private _selectedItem: any = null;\n\n private _isAutoCompleting: boolean = false;\n\n private _inputRef: HTMLInputElement;\n\n get _items() {\n if (!this.items || this.loading) {\n return [];\n }\n\n let items =\n typeof this.items === 'string'\n ? JSON.parse(this.items)\n : this.items;\n\n if (typeof items?.[0] === 'string') {\n this.displayKey = 'text';\n this.valueKey = 'value';\n\n items = items.map((str) => ({\n value: str,\n text: str,\n }));\n }\n\n if (this._isAutoCompleting && this.query?.length && !this.asyncFilter) {\n items = items.filter((item) => {\n if (this.queryKey) {\n return this._checkvalue(this.queryKey, item);\n }\n\n return (\n this._checkvalue(this.valueKey, item) ||\n this._checkvalue(this.displayKey, item)\n );\n });\n }\n\n return items?.slice(0, this.maxDisplayedItems);\n }\n\n get _displayValue() {\n if (this._isAutoCompleting) {\n return this.query;\n }\n\n return this._selectedItem?.[this.displayKey];\n }\n\n get _placeholder() {\n return this._isAutoCompleting && this.autocompletePlaceholder?.length\n ? this.autocompletePlaceholder\n : this.placeholder;\n }\n\n componentDidLoad() {\n if (this.value) {\n this._valueChange(this.value);\n return;\n }\n\n if (this.autoSelectFirst) {\n this._selectedItem = this._items?.[0];\n }\n }\n\n render() {\n return (\n <Host class=\"p-select\">\n <p-dropdown\n disableTriggerClick={true}\n calculateWidth={true}\n insideClick={true}\n show={this._showDropdown}\n >\n <p-input-group\n slot=\"trigger\"\n icon={this.icon}\n size={this.size}\n prefix={this.prefix}\n label={this.label}\n helper={this.helper}\n error={this.error}\n disabled={this.disabled}\n focused={this._showDropdown}\n >\n <input\n slot=\"input\"\n type=\"text\"\n placeholder={this._placeholder}\n value={this._displayValue}\n class={`p-input cursor-pointer ${\n !this._isAutoCompleting && 'read-only'\n }`}\n onFocus={() => this._onFocus()}\n onMouseDown={(ev) => this._onMouseDown(ev)}\n onClick={() => this._onClick()}\n onInput={(ev) => this._onChange(ev)}\n ref={(ref) => (this._inputRef = ref)}\n />\n\n {this.showChevron && (\n <p-icon variant=\"chevron\" slot=\"suffix\" />\n )}\n </p-input-group>\n <div slot=\"items\">\n {this.loading\n ? this._getLoadingItems()\n : this._getItems()}\n </div>\n </p-dropdown>\n </Host>\n );\n }\n\n @Listen('click', { target: 'document', capture: true })\n protected documentClickHandler({ target }) {\n if (!this._showDropdown || childOf(target, this._el)) {\n return;\n }\n\n this._showDropdown = false;\n this._isAutoCompleting = false;\n }\n\n @Watch('value')\n private _valueChange(value: any) {\n this._preselectItem(value);\n }\n\n @Watch('items')\n public itemChanges() {\n this._preselectItem();\n }\n\n @Watch('_showDropdown')\n public _showDropdownChanges() {\n this.dropdownShown.emit({\n value: this._showDropdown,\n query: this.query,\n });\n }\n\n private _preselectItem(value?: any) {\n value = value === undefined ? null : value;\n const parsedValue = !!this.value\n ? JSON.stringify(this.value)\n : JSON.stringify(value);\n\n if (\n this._selectedItem &&\n JSON.stringify(this._selectedItem[this.valueKey]) === parsedValue\n ) {\n return;\n }\n\n const item = this._items.find(\n (i) => JSON.stringify(i?.[this.valueKey]) === parsedValue\n );\n\n this._selectedItem = item;\n }\n\n private _selectValue(item) {\n this._selectedItem = item;\n const value = item[this.valueKey];\n\n this.value = value;\n this.valueChange.emit(this.value);\n\n this._onBlur(true);\n }\n\n private _onFocus() {\n if (!this.items.length && !this.loading) {\n return;\n }\n\n if (!this.enableAutocomplete) {\n this._inputRef.blur();\n if (!this._showDropdown) {\n this._showDropdown = true;\n }\n return;\n }\n\n this._isAutoCompleting = true;\n this._showDropdown = true;\n }\n\n private _onMouseDown(ev) {\n if (this.enableAutocomplete) {\n return;\n }\n\n ev.preventDefault();\n }\n\n private _onClick() {\n if (this.enableAutocomplete) {\n return;\n }\n\n this._showDropdown = !this._showDropdown;\n }\n\n private _onBlur(force = false) {\n if (!this.enableAutocomplete && !force) {\n return;\n }\n\n this._isAutoCompleting = false;\n this._showDropdown = false;\n }\n\n private _onChange(ev) {\n if (!this._isAutoCompleting) {\n return;\n }\n\n this.query = ev.target.value;\n this.queryChange.emit(this.query);\n }\n\n private _checkvalue(key, item) {\n return (\n item?.[key]\n ?.toString()\n ?.toLowerCase()\n .indexOf(this.query?.toLowerCase()) >= 0\n );\n }\n\n private _getItems() {\n return this._items.map((item) => (\n <p-dropdown-menu-item\n onClick={() => this._selectValue(item)}\n active={\n item[this.valueKey] === this._selectedItem?.[this.valueKey]\n }\n >\n {item[this.displayKey]}\n </p-dropdown-menu-item>\n ));\n }\n\n private _getLoadingItems() {\n return [0, 0, 0].map(() => (\n <p-dropdown-menu-item enableHover={false}>\n <p-loader variant=\"ghost\" class=\"h-6 w-full rounded\" />\n </p-dropdown-menu-item>\n ));\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAqB,2yL,MCoBdC,EAAM,M,wJAiIPC,KAAAC,kBAA6B,M,qKA/FR,O,cAKF,Q,6CAUQ,K,iBAKJ,K,uBAKK,G,wBAKE,K,iBAKP,M,aAKJ,M,UAoBQ,S,oGAyBU,M,mBAOP,M,mBACA,I,CAMlCC,a,MACA,IAAKF,KAAKG,OAASH,KAAKI,QAAS,CAC7B,MAAO,E,CAGX,IAAID,SACOH,KAAKG,QAAU,SAChBE,KAAKC,MAAMN,KAAKG,OAChBH,KAAKG,MAEf,UAAWA,IAAK,MAALA,SAAK,SAALA,EAAQ,MAAO,SAAU,CAChCH,KAAKO,WAAa,OAClBP,KAAKQ,SAAW,QAEhBL,EAAQA,EAAMM,KAAKC,IAAG,CAClBC,MAAOD,EACPE,KAAMF,K,CAId,GAAIV,KAAKC,qBAAqBY,EAAAb,KAAKc,SAAK,MAAAD,SAAA,SAAAA,EAAEE,UAAWf,KAAKgB,YAAa,CACnEb,EAAQA,EAAMc,QAAQC,IAClB,GAAIlB,KAAKmB,SAAU,CACf,OAAOnB,KAAKoB,Y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,KAAKC,kBAAoB,KACzBD,KAAKuC,cAAgB,I,CAGjBe,aAAaD,GACjB,GAAIrD,KAAKkF,mBAAoB,CACzB,M,CAGJ7B,EAAG+B,gB,CAGC5B,WACJ,GAAIxD,KAAKkF,mBAAoB,CACzB,M,CAGJlF,KAAKuC,eAAiBvC,KAAKuC,a,CAGvB0C,QAAQI,EAAQ,OACpB,IAAKrF,KAAKkF,qBAAuBG,EAAO,CACpC,M,CAGJrF,KAAKC,kBAAoB,MACzBD,KAAKuC,cAAgB,K,CAGjBmB,UAAUL,GACd,IAAKrD,KAAKC,kBAAmB,CACzB,M,CAGJD,KAAKc,MAAQuC,EAAGa,OAAOvD,MACvBX,KAAKsF,YAAYb,KAAKzE,KAAKc,M,CAGvBM,YAAYmE,EAAKrE,G,UACrB,QACIsE,GAAA3E,EAAAK,IAAI,MAAJA,SAAI,SAAJA,EAAOqE,MAAI,MAAA1E,SAAA,SAAAA,EACL4E,cAAU,MAAAD,SAAA,SAAAA,EACVE,cACDC,SAAQC,EAAA5F,KAAKc,SAAK,MAAA8E,SAAA,SAAAA,EAAEF,iBAAkB,C,CAI3C1B,YACJ,OAAOhE,KAAKE,OAAOO,KAAKS,I,MAAS,OAC7Bc,EAAA,wBACIuB,QAAS,IAAMvD,KAAK+E,aAAa7D,GACjC2E,OACI3E,EAAKlB,KAAKQ,cAAcK,EAAAb,KAAKwB,iBAAa,MAAAX,SAAA,SAAAA,EAAGb,KAAKQ,YAGrDU,EAAKlB,KAAKO,YACQ,G,CAIvBwD,mBACJ,MAAO,CAAC,EAAG,EAAG,GAAGtD,KAAI,IACjBuB,EAAA,wBAAsB8D,YAAa,OAC/B9D,EAAA,YAAU8B,QAAQ,QAAQ5B,MAAM,yB"}
@@ -0,0 +1,2 @@
1
+ import{r as t,h as e,H as i,g as s}from"./p-69d43b9d.js";const o=".static{position:static!important}.flex{display:flex!important}.h-auto{height:auto!important}.w-full{width:100%!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}*{box-sizing:border-box}:host{display:flex}:host([direction=horizontal]){align-items:flex-end;height:auto}:host([direction=vertical]){align-items:flex-start;flex-direction:column;flex-wrap:wrap;min-height:100%;width:100%}:host([direction=vertical][content-position=start]){align-items:flex-end}";const r=class{constructor(e){t(this,e);this.activeStep=1;this.direction="horizontal";this.contentPosition="end"}componentDidRender(){this._generateSteps()}render(){return e(i,{class:"p-stepper"},e("slot",null))}_generateSteps(){let t=this.activeStep-1;const e=this._el.querySelectorAll("p-stepper-item, p-stepper-line");if(!!this.activeStep||t<=0){const i=Array.from(e);const s=i.findIndex((t=>t.tagName.toLowerCase()==="p-stepper-item"&&t.active&&!t.finished));if(s>=0){t=s}const o=i.findIndex((t=>t.tagName.toLowerCase()==="p-stepper-item"&&t.finished));if(t<=0&&o>=0){t=o+1}}for(let i=0;i<(e===null||e===void 0?void 0:e.length);i++){const s=e.item(i);if(s.tagName.toLowerCase()==="p-stepper-item"){s.active=i===t;s.finished=i<t;s.direction=this.direction;s.align=i===0?"start":i===(e===null||e===void 0?void 0:e.length)-1?"end":"center";s.contentPosition=this.contentPosition;if(i>0){const o=e.item(i+1);if(!o||o.tagName.toLowerCase()==="p-stepper-item"){const e=(s.clientHeight-16)/2;const o=document.createElement("p-stepper-line");o.direction=this.direction;o.active=i<=t;if(e>0&&this.direction==="vertical"){o.style.marginTop=`-${e/16}rem`;o.style.marginBottom=`-${e/16}rem`;o.style.minHeight=`calc(1rem + ${e*2/16}rem)`}this._el.insertBefore(o,s);continue}if(o.tagName.toLowerCase()==="p-stepper-line"){o.direction=this.direction;o.active=i<=t}}}}}get _el(){return s(this)}};r.style=o;export{r as p_stepper};
2
+ //# sourceMappingURL=p-b61128d4.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stepperComponentCss","Stepper","componentDidRender","this","_generateSteps","render","h","Host","class","activeStep","items","_el","querySelectorAll","arrayItems","Array","from","activeItemIndex","findIndex","i","tagName","toLowerCase","active","finished","finishedItemIndex","length","item","direction","align","contentPosition","nextItem","heightDiff","clientHeight","stepperLine","document","createElement","style","marginTop","marginBottom","minHeight","insertBefore"],"sources":["./src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","./src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n @apply flex;\n}\n\n:host([direction='horizontal']) {\n @apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n @apply flex-col flex-wrap items-start;\n @apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n @apply items-end;\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'p-stepper',\n styleUrl: 'stepper.component.scss',\n shadow: true,\n})\nexport class Stepper {\n /**\n * The currently active step\n */\n @Prop() activeStep: number = 1;\n\n /**\n * The direction of the stepper\n */\n @Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n 'horizontal';\n\n /**\n * The position of the content in case of vertical direction\n */\n @Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n // private _steps: Array<HTMLPStepperItemElement>;\n\n componentDidRender() {\n this._generateSteps();\n }\n\n render() {\n return (\n <Host class=\"p-stepper\">\n <slot />\n </Host>\n );\n }\n\n private _generateSteps() {\n let activeStep = this.activeStep - 1;\n const items = this._el.querySelectorAll(\n 'p-stepper-item, p-stepper-line'\n );\n\n if (!!this.activeStep || activeStep <= 0) {\n const arrayItems = Array.from(items);\n const activeItemIndex = arrayItems.findIndex(\n (i: any) =>\n i.tagName.toLowerCase() === 'p-stepper-item' &&\n i.active &&\n !i.finished\n );\n\n if (activeItemIndex >= 0) {\n activeStep = activeItemIndex;\n }\n\n const finishedItemIndex = arrayItems.findIndex(\n (i: any) =>\n i.tagName.toLowerCase() === 'p-stepper-item' && i.finished\n );\n if (activeStep <= 0 && finishedItemIndex >= 0) {\n activeStep = finishedItemIndex + 1;\n }\n }\n\n for (let i = 0; i < items?.length; i++) {\n const item = items.item(i) as any;\n\n if (item.tagName.toLowerCase() === 'p-stepper-item') {\n item.active = i === activeStep;\n item.finished = i < activeStep;\n item.direction = this.direction;\n item.align =\n i === 0\n ? 'start'\n : i === items?.length - 1\n ? 'end'\n : 'center';\n item.contentPosition = this.contentPosition;\n\n if (i > 0) {\n const nextItem = items.item(i + 1) as any;\n\n if (\n !nextItem ||\n nextItem.tagName.toLowerCase() === 'p-stepper-item'\n ) {\n const heightDiff = (item.clientHeight - 16) / 2;\n\n const stepperLine =\n document.createElement('p-stepper-line');\n stepperLine.direction = this.direction;\n stepperLine.active = i <= activeStep;\n\n if (heightDiff > 0 && this.direction === 'vertical') {\n stepperLine.style.marginTop = `-${\n heightDiff / 16\n }rem`;\n stepperLine.style.marginBottom = `-${\n heightDiff / 16\n }rem`;\n stepperLine.style.minHeight = `calc(1rem + ${\n (heightDiff * 2) / 16\n }rem)`;\n }\n\n this._el.insertBefore(stepperLine, item);\n\n continue;\n }\n\n if (nextItem.tagName.toLowerCase() === 'p-stepper-line') {\n nextItem.direction = this.direction;\n nextItem.active = i <= activeStep;\n }\n }\n }\n }\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAsB,if,MCOfC,EAAO,M,yCAIa,E,eAMzB,a,qBAKwD,K,CAS5DC,qBACIC,KAAKC,gB,CAGTC,SACI,OACIC,EAACC,EAAI,CAACC,MAAM,aACRF,EAAA,a,CAKJF,iBACJ,IAAIK,EAAaN,KAAKM,WAAa,EACnC,MAAMC,EAAQP,KAAKQ,IAAIC,iBACnB,kCAGJ,KAAMT,KAAKM,YAAcA,GAAc,EAAG,CACtC,MAAMI,EAAaC,MAAMC,KAAKL,GAC9B,MAAMM,EAAkBH,EAAWI,WAC9BC,GACGA,EAAEC,QAAQC,gBAAkB,kBAC5BF,EAAEG,SACDH,EAAEI,WAGX,GAAIN,GAAmB,EAAG,CACtBP,EAAaO,C,CAGjB,MAAMO,EAAoBV,EAAWI,WAChCC,GACGA,EAAEC,QAAQC,gBAAkB,kBAAoBF,EAAEI,WAE1D,GAAIb,GAAc,GAAKc,GAAqB,EAAG,CAC3Cd,EAAac,EAAoB,C,EAIzC,IAAK,IAAIL,EAAI,EAAGA,GAAIR,IAAK,MAALA,SAAK,SAALA,EAAOc,QAAQN,IAAK,CACpC,MAAMO,EAAOf,EAAMe,KAAKP,GAExB,GAAIO,EAAKN,QAAQC,gBAAkB,iBAAkB,CACjDK,EAAKJ,OAASH,IAAMT,EACpBgB,EAAKH,SAAWJ,EAAIT,EACpBgB,EAAKC,UAAYvB,KAAKuB,UACtBD,EAAKE,MACDT,IAAM,EACA,QACAA,KAAMR,IAAK,MAALA,SAAK,SAALA,EAAOc,QAAS,EACtB,MACA,SACVC,EAAKG,gBAAkBzB,KAAKyB,gBAE5B,GAAIV,EAAI,EAAG,CACP,MAAMW,EAAWnB,EAAMe,KAAKP,EAAI,GAEhC,IACKW,GACDA,EAASV,QAAQC,gBAAkB,iBACrC,CACE,MAAMU,GAAcL,EAAKM,aAAe,IAAM,EAE9C,MAAMC,EACFC,SAASC,cAAc,kBAC3BF,EAAYN,UAAYvB,KAAKuB,UAC7BM,EAAYX,OAASH,GAAKT,EAE1B,GAAIqB,EAAa,GAAK3B,KAAKuB,YAAc,WAAY,CACjDM,EAAYG,MAAMC,UAAY,IAC1BN,EAAa,QAEjBE,EAAYG,MAAME,aAAe,IAC7BP,EAAa,QAEjBE,EAAYG,MAAMG,UAAY,eACzBR,EAAa,EAAK,Q,CAI3B3B,KAAKQ,IAAI4B,aAAaP,EAAaP,GAEnC,Q,CAGJ,GAAII,EAASV,QAAQC,gBAAkB,iBAAkB,CACrDS,EAASH,UAAYvB,KAAKuB,UAC1BG,EAASR,OAASH,GAAKT,C"}
@@ -1,2 +1,2 @@
1
- import{p as e,b as a}from"./p-69d43b9d.js";export{s as setNonce}from"./p-69d43b9d.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a(JSON.parse('[["p-3d68b72f",[[4,"p-button",{"variant":[1],"href":[1],"target":[1],"size":[1],"loading":[4],"chevron":[8],"chevronPosition":[1,"chevron-position"],"disabled":[4],"icon":[1],"iconOnly":[4,"icon-only"],"iconPosition":[1,"icon-position"],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"inheritText":[4,"inherit-text"]},[[2,"click","handleClick"]]],[1,"p-loader",{"show":[4],"variant":[1],"color":[1],"modalTitle":[1,"modal-title"],"modalDescription":[1,"modal-description"]}],[0,"p-icon",{"variant":[1],"size":[1],"rotate":[2],"flip":[1]}]]],["p-2bc6b026",[[0,"p-table",{"items":[1],"loading":[4],"headerLoading":[4,"header-loading"],"footerLoading":[4,"footer-loading"],"amountOfLoadingRows":[2,"amount-of-loading-rows"],"enableRowSelection":[4,"enable-row-selection"],"enableRowClick":[4,"enable-row-click"],"selectedRows":[16],"selectionKey":[1,"selection-key"],"canSelectKey":[1,"can-select-key"],"quickFilters":[16],"activeQuickFilterIdentifier":[1,"active-quick-filter-identifier"],"enableSearch":[4,"enable-search"],"query":[1025],"enableFilter":[4,"enable-filter"],"selectedFiltersAmount":[2,"selected-filters-amount"],"filterButtonTemplate":[16],"enableEdit":[4,"enable-edit"],"editButtonTemplate":[16],"enablePageSize":[4,"enable-page-size"],"enablePagination":[4,"enable-pagination"],"enableExport":[4,"enable-export"],"page":[1538],"total":[2],"pageSize":[2,"page-size"],"pageSizeOptions":[16],"hideOnSinglePage":[4,"hide-on-single-page"],"emptyStateHeader":[16],"emptyStateContent":[16],"emptyStateAction":[16],"emptyStateFilteredHeader":[16],"emptyStateFilteredContent":[16],"_locales":[32],"_columns":[32],"_items":[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"]]]]],["p-19c08855",[[1,"p-modal",{"size":[1],"variant":[1],"header":[1],"show":[4],"applyBlur":[4,"apply-blur"],"showClose":[4,"show-close"],"showMobileFooter":[4,"show-mobile-footer"],"backdropClickClose":[4,"backdrop-click-close"],"scrollLock":[4,"scroll-lock"],"_closing":[32]}]]],["p-f1284018",[[0,"p-select",{"items":[1],"icon":[1],"query":[1],"placeholder":[1],"autocompletePlaceholder":[1,"autocomplete-placeholder"],"value":[8],"displayKey":[1,"display-key"],"valueKey":[1,"value-key"],"queryKey":[1,"query-key"],"autoSelectFirst":[4,"auto-select-first"],"showChevron":[4,"show-chevron"],"maxDisplayedItems":[2,"max-displayed-items"],"enableAutocomplete":[4,"enable-autocomplete"],"asyncFilter":[4,"async-filter"],"loading":[4],"size":[1],"prefix":[1],"label":[1],"helper":[1],"error":[513],"disabled":[516],"_showDropdown":[32],"_selectedItem":[32]},[[6,"click","documentClickHandler"]]]]],["p-83f1ceef",[[0,"p-datepicker",{"placeholder":[1],"value":[8],"preselectToday":[4,"preselect-today"],"disabledDates":[1,"disabled-dates"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"disableWeekends":[4,"disable-weekends"],"mode":[1],"format":[1],"size":[1],"prefix":[1],"label":[1],"helper":[1],"error":[513],"disabled":[516],"_showDropdown":[32],"_value":[32],"_minDate":[32],"_maxDate":[32],"_disabledDates":[32]},[[6,"click","documentClickHandler"]]]]],["p-8120c40f",[[1,"p-drawer",{"header":[1],"show":[4],"applyBlur":[4,"apply-blur"],"showClose":[4,"show-close"],"backdropClickClose":[4,"backdrop-click-close"],"canClose":[4,"can-close"],"scrollLock":[4,"scroll-lock"],"_closing":[32]}]]],["p-e20ff8c8",[[1,"p-attachment",{"mode":[1],"loading":[4],"error":[1]}]]],["p-594d1cf6",[[1,"p-navbar",{"closeText":[1,"close-text"],"menuText":[1,"menu-text"],"_showMenu":[32]},[[8,"closeNavbar","handleCloseNavbar"],[8,"openNavbar","handleOpenNavbar"]]]]],["p-bd13aa1f",[[1,"p-profile",{"variant":[1],"size":[513],"_dropdownOpen":[32]}]]],["p-0f3bd28b",[[1,"p-toast",{"variant":[1],"header":[1],"content":[1],"enableAction":[4,"enable-action"],"actionIcon":[1,"action-icon"],"actionIconFlip":[1,"action-icon-flip"],"actionIconRotate":[2,"action-icon-rotate"]}]]],["p-0b9838ca",[[1,"p-accordion",{"header":[1],"open":[4],"closeable":[4],"openable":[4]}]]],["p-b2af2dd2",[[1,"p-navigation-item",{"active":[4],"icon":[1],"counter":[8],"href":[1],"target":[1]}]]],["p-3e858d20",[[4,"p-card-header",{"header":[1],"arrow":[4]}]]],["p-268227ff",[[1,"p-content-slider",{"hideMobileIndicator":[4,"hide-mobile-indicator"],"disableDrag":[4,"disable-drag"],"disableAutoCenter":[4,"disable-auto-center"],"disableIndicatorClick":[4,"disable-indicator-click"],"_visibleIndex":[32],"_outerHeight":[32],"_totalWidth":[32],"_dragging":[32]},[[9,"mouseup","mouseUpHandler"],[9,"touchend","mouseUpHandler"],[9,"resize","resizeHandler"]]]]],["p-b131d8d5",[[1,"p-info-panel",{"variant":[1],"header":[1],"content":[1],"closeable":[4]}]]],["p-a0d40482",[[4,"p-status",{"variant":[1],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]}]]],["p-c1b67ebb",[[1,"p-stepper-line",{"active":[516],"direction":[513]}]]],["p-3a6e2934",[[1,"p-stepper",{"activeStep":[2,"active-step"],"direction":[513],"contentPosition":[513,"content-position"]}]]],["p-086cd638",[[1,"p-stepper-item",{"align":[513],"direction":[513],"contentPosition":[513,"content-position"],"finished":[516],"active":[516]}]]],["p-7171690b",[[1,"p-divider"]]],["p-5ab56199",[[1,"p-tab-group"]]],["p-4c3d6a7f",[[0,"p-avatar",{"variant":[513],"size":[513],"defaultImage":[1,"default-image"],"src":[1],"_src":[32]}]]],["p-966917a1",[[4,"p-avatar-group",{"extra":[2]}]]],["p-6966b84f",[[4,"p-card-body",{"inheritText":[516,"inherit-text"]}]]],["p-71b442d7",[[1,"p-card-container",{"hoverable":[516],"shadow":[516]}]]],["p-a46af8b4",[[1,"p-layout",{"variant":[1]}]]],["p-a0a27d24",[[1,"p-tab-item",{"active":[4]}]]],["p-6645532b",[[0,"p-table-column",{"path":[1537],"type":[1537],"name":[1537],"useSlot":[1540,"use-slot"],"align":[1537],"sizes":[1032]}]]],["p-6a5f5cc4",[[1,"p-toast-container",{"placement":[1]}]]],["p-04756580",[[1,"p-calendar",{"variant":[1],"value":[1],"preselectToday":[4,"preselect-today"],"disabledDates":[1,"disabled-dates"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"disableWeekends":[4,"disable-weekends"],"mode":[1],"_view":[32],"_viewDate":[32],"_value":[32],"_minDate":[32],"_maxDate":[32],"_disabledDates":[32]}]]],["p-004340ec",[[1,"p-counter",{"variant":[1],"size":[1]}]]],["p-25ac3f10",[[1,"p-slider-indicator",{"active":[4]}]]],["p-11929d70",[[1,"p-drawer-header",{"showClose":[4,"show-close"]}],[1,"p-drawer-body",{"variant":[1]}],[4,"p-drawer-container",{"closing":[4]}]]],["p-5dfab26d",[[1,"p-backdrop",{"variant":[1],"applyBlur":[4,"apply-blur"],"closing":[4],"scrollLock":[4,"scroll-lock"]},[[2,"click","handleClick"]]]]],["p-bff2caf8",[[1,"p-modal-header",{"showClose":[4,"show-close"]}],[1,"p-modal-footer"],[1,"p-modal-body",{"variant":[1],"rounded":[4]}],[4,"p-modal-container",{"size":[1],"closing":[4]}]]],["p-846dd0bb",[[1,"p-label",{"variant":[513],"behavior":[513],"icon":[513],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"size":[513],"keepMobileContent":[516,"keep-mobile-content"]}],[1,"p-segment-item",{"active":[4],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]}],[4,"p-segment-container"]]],["p-f98027f1",[[4,"p-dropdown-menu-container",{"maxWidth":[4,"max-width"],"fullWidth":[4,"full-width"]}]]],["p-d86e3e82",[[1,"p-dropdown-menu-item",{"active":[4],"enableHover":[4,"enable-hover"],"icon":[1]}],[1,"p-dropdown",{"placement":[513],"strategy":[1],"show":[4],"calculateWidth":[4,"calculate-width"],"applyMaxWidth":[4,"apply-max-width"],"applyFullWidth":[4,"apply-full-width"],"insideClick":[4,"inside-click"],"disableTriggerClick":[4,"disable-trigger-click"],"chevronPosition":[1,"chevron-position"],"chevronDirection":[1,"chevron-direction"]},[[6,"click","documentClickHandler"]]]]],["p-4fc82528",[[1,"p-page-size-select",{"size":[1538],"sizeOptions":[16],"chevronPosition":[1,"chevron-position"],"buttonSize":[1,"button-size"],"buttonTemplate":[16],"itemTemplate":[16],"hidden":[4],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[0,"p-pagination",{"page":[1538],"pageSize":[2,"page-size"],"hideOnSinglePage":[4,"hide-on-single-page"],"total":[2]}],[1,"p-pagination-item",{"active":[4]}]]],["p-50789b59",[[1,"p-tooltip",{"variant":[1],"popover":[8],"placement":[1],"strategy":[1],"show":[4],"canManuallyClose":[4,"can-manually-close"]},[[2,"click","clickHandler"],[6,"click","documentClickHandler"],[1,"mouseenter","mouseEnterHandler"],[0,"focus","mouseEnterHandler"],[1,"mouseleave","mouseLeaveHandler"],[0,"blur","mouseLeaveHandler"]]]]],["p-23f04588",[[1,"p-input-group",{"size":[1],"prefix":[1],"suffix":[1],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"iconPosition":[1,"icon-position"],"label":[1],"helper":[1],"required":[516],"error":[513],"disabled":[516],"focused":[516],"_forceShowTooltip":[32]},[[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"]]],[1,"p-helper",{"placement":[1]}],[1,"p-input-error",{"error":[1],"forceShowTooltip":[4,"force-show-tooltip"],"_showTooltip":[32]}]]],["p-bdaeb7c7",[[1,"p-table-header",{"quickFilters":[16],"activeQuickFilterIdentifier":[1,"active-quick-filter-identifier"],"loading":[4],"enableSearch":[4,"enable-search"],"itemsSelectedAmount":[2,"items-selected-amount"],"query":[1025],"enableFilter":[4,"enable-filter"],"selectedFiltersAmount":[2,"selected-filters-amount"],"filterButtonTemplate":[16],"enableEdit":[4,"enable-edit"],"canEdit":[1028,"can-edit"],"editButtonTemplate":[16],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[1,"p-table-footer",{"enablePageSize":[4,"enable-page-size"],"enablePagination":[4,"enable-pagination"],"enableExport":[4,"enable-export"],"loading":[4],"page":[1538],"total":[2],"pageSize":[2,"page-size"],"pageSizeOptions":[16],"hideOnSinglePage":[4,"hide-on-single-page"],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[4,"p-table-cell",{"variant":[1],"index":[2],"rowIndex":[2,"row-index"],"definition":[16],"item":[8],"value":[8],"checkbox":[8],"template":[16]}],[1,"p-table-row",{"variant":[1],"enableHover":[4,"enable-hover"]}],[0,"p-illustration",{"variant":[1]}],[1,"p-table-container"]]]]'),e)));
1
+ import{p as e,b as a}from"./p-69d43b9d.js";export{s as setNonce}from"./p-69d43b9d.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a(JSON.parse('[["p-3d68b72f",[[4,"p-button",{"variant":[1],"href":[1],"target":[1],"size":[1],"loading":[4],"chevron":[8],"chevronPosition":[1,"chevron-position"],"disabled":[4],"icon":[1],"iconOnly":[4,"icon-only"],"iconPosition":[1,"icon-position"],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"inheritText":[4,"inherit-text"]},[[2,"click","handleClick"]]],[1,"p-loader",{"show":[4],"variant":[1],"color":[1],"modalTitle":[1,"modal-title"],"modalDescription":[1,"modal-description"]}],[0,"p-icon",{"variant":[1],"size":[1],"rotate":[2],"flip":[1]}]]],["p-2bc6b026",[[0,"p-table",{"items":[1],"loading":[4],"headerLoading":[4,"header-loading"],"footerLoading":[4,"footer-loading"],"amountOfLoadingRows":[2,"amount-of-loading-rows"],"enableRowSelection":[4,"enable-row-selection"],"enableRowClick":[4,"enable-row-click"],"selectedRows":[16],"selectionKey":[1,"selection-key"],"canSelectKey":[1,"can-select-key"],"quickFilters":[16],"activeQuickFilterIdentifier":[1,"active-quick-filter-identifier"],"enableSearch":[4,"enable-search"],"query":[1025],"enableFilter":[4,"enable-filter"],"selectedFiltersAmount":[2,"selected-filters-amount"],"filterButtonTemplate":[16],"enableEdit":[4,"enable-edit"],"editButtonTemplate":[16],"enablePageSize":[4,"enable-page-size"],"enablePagination":[4,"enable-pagination"],"enableExport":[4,"enable-export"],"page":[1538],"total":[2],"pageSize":[2,"page-size"],"pageSizeOptions":[16],"hideOnSinglePage":[4,"hide-on-single-page"],"emptyStateHeader":[16],"emptyStateContent":[16],"emptyStateAction":[16],"emptyStateFilteredHeader":[16],"emptyStateFilteredContent":[16],"_locales":[32],"_columns":[32],"_items":[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"]]]]],["p-19c08855",[[1,"p-modal",{"size":[1],"variant":[1],"header":[1],"show":[4],"applyBlur":[4,"apply-blur"],"showClose":[4,"show-close"],"showMobileFooter":[4,"show-mobile-footer"],"backdropClickClose":[4,"backdrop-click-close"],"scrollLock":[4,"scroll-lock"],"_closing":[32]}]]],["p-33f16166",[[0,"p-select",{"items":[1],"icon":[1],"query":[1],"placeholder":[1],"autocompletePlaceholder":[1,"autocomplete-placeholder"],"value":[8],"displayKey":[1,"display-key"],"valueKey":[1,"value-key"],"queryKey":[1,"query-key"],"autoSelectFirst":[4,"auto-select-first"],"showChevron":[4,"show-chevron"],"maxDisplayedItems":[2,"max-displayed-items"],"enableAutocomplete":[4,"enable-autocomplete"],"asyncFilter":[4,"async-filter"],"loading":[4],"size":[1],"prefix":[1],"label":[1],"helper":[1],"error":[513],"disabled":[516],"_showDropdown":[32],"_selectedItem":[32]},[[6,"click","documentClickHandler"]]]]],["p-83f1ceef",[[0,"p-datepicker",{"placeholder":[1],"value":[8],"preselectToday":[4,"preselect-today"],"disabledDates":[1,"disabled-dates"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"disableWeekends":[4,"disable-weekends"],"mode":[1],"format":[1],"size":[1],"prefix":[1],"label":[1],"helper":[1],"error":[513],"disabled":[516],"_showDropdown":[32],"_value":[32],"_minDate":[32],"_maxDate":[32],"_disabledDates":[32]},[[6,"click","documentClickHandler"]]]]],["p-8120c40f",[[1,"p-drawer",{"header":[1],"show":[4],"applyBlur":[4,"apply-blur"],"showClose":[4,"show-close"],"backdropClickClose":[4,"backdrop-click-close"],"canClose":[4,"can-close"],"scrollLock":[4,"scroll-lock"],"_closing":[32]}]]],["p-e20ff8c8",[[1,"p-attachment",{"mode":[1],"loading":[4],"error":[1]}]]],["p-594d1cf6",[[1,"p-navbar",{"closeText":[1,"close-text"],"menuText":[1,"menu-text"],"_showMenu":[32]},[[8,"closeNavbar","handleCloseNavbar"],[8,"openNavbar","handleOpenNavbar"]]]]],["p-bd13aa1f",[[1,"p-profile",{"variant":[1],"size":[513],"_dropdownOpen":[32]}]]],["p-0f3bd28b",[[1,"p-toast",{"variant":[1],"header":[1],"content":[1],"enableAction":[4,"enable-action"],"actionIcon":[1,"action-icon"],"actionIconFlip":[1,"action-icon-flip"],"actionIconRotate":[2,"action-icon-rotate"]}]]],["p-0b9838ca",[[1,"p-accordion",{"header":[1],"open":[4],"closeable":[4],"openable":[4]}]]],["p-b2af2dd2",[[1,"p-navigation-item",{"active":[4],"icon":[1],"counter":[8],"href":[1],"target":[1]}]]],["p-3e858d20",[[4,"p-card-header",{"header":[1],"arrow":[4]}]]],["p-268227ff",[[1,"p-content-slider",{"hideMobileIndicator":[4,"hide-mobile-indicator"],"disableDrag":[4,"disable-drag"],"disableAutoCenter":[4,"disable-auto-center"],"disableIndicatorClick":[4,"disable-indicator-click"],"_visibleIndex":[32],"_outerHeight":[32],"_totalWidth":[32],"_dragging":[32]},[[9,"mouseup","mouseUpHandler"],[9,"touchend","mouseUpHandler"],[9,"resize","resizeHandler"]]]]],["p-b131d8d5",[[1,"p-info-panel",{"variant":[1],"header":[1],"content":[1],"closeable":[4]}]]],["p-a0d40482",[[4,"p-status",{"variant":[1],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]}]]],["p-c1b67ebb",[[1,"p-stepper-line",{"active":[516],"direction":[513]}]]],["p-b61128d4",[[1,"p-stepper",{"activeStep":[2,"active-step"],"direction":[513],"contentPosition":[513,"content-position"]}]]],["p-1b6cfd6c",[[1,"p-stepper-item",{"align":[513],"direction":[513],"contentPosition":[513,"content-position"],"finished":[516],"active":[516]}]]],["p-7171690b",[[1,"p-divider"]]],["p-5ab56199",[[1,"p-tab-group"]]],["p-4c3d6a7f",[[0,"p-avatar",{"variant":[513],"size":[513],"defaultImage":[1,"default-image"],"src":[1],"_src":[32]}]]],["p-966917a1",[[4,"p-avatar-group",{"extra":[2]}]]],["p-6966b84f",[[4,"p-card-body",{"inheritText":[516,"inherit-text"]}]]],["p-71b442d7",[[1,"p-card-container",{"hoverable":[516],"shadow":[516]}]]],["p-a46af8b4",[[1,"p-layout",{"variant":[1]}]]],["p-a0a27d24",[[1,"p-tab-item",{"active":[4]}]]],["p-6645532b",[[0,"p-table-column",{"path":[1537],"type":[1537],"name":[1537],"useSlot":[1540,"use-slot"],"align":[1537],"sizes":[1032]}]]],["p-6a5f5cc4",[[1,"p-toast-container",{"placement":[1]}]]],["p-04756580",[[1,"p-calendar",{"variant":[1],"value":[1],"preselectToday":[4,"preselect-today"],"disabledDates":[1,"disabled-dates"],"minDate":[1,"min-date"],"maxDate":[1,"max-date"],"disableWeekends":[4,"disable-weekends"],"mode":[1],"_view":[32],"_viewDate":[32],"_value":[32],"_minDate":[32],"_maxDate":[32],"_disabledDates":[32]}]]],["p-004340ec",[[1,"p-counter",{"variant":[1],"size":[1]}]]],["p-25ac3f10",[[1,"p-slider-indicator",{"active":[4]}]]],["p-11929d70",[[1,"p-drawer-header",{"showClose":[4,"show-close"]}],[1,"p-drawer-body",{"variant":[1]}],[4,"p-drawer-container",{"closing":[4]}]]],["p-5dfab26d",[[1,"p-backdrop",{"variant":[1],"applyBlur":[4,"apply-blur"],"closing":[4],"scrollLock":[4,"scroll-lock"]},[[2,"click","handleClick"]]]]],["p-bff2caf8",[[1,"p-modal-header",{"showClose":[4,"show-close"]}],[1,"p-modal-footer"],[1,"p-modal-body",{"variant":[1],"rounded":[4]}],[4,"p-modal-container",{"size":[1],"closing":[4]}]]],["p-846dd0bb",[[1,"p-label",{"variant":[513],"behavior":[513],"icon":[513],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"size":[513],"keepMobileContent":[516,"keep-mobile-content"]}],[1,"p-segment-item",{"active":[4],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"]}],[4,"p-segment-container"]]],["p-f98027f1",[[4,"p-dropdown-menu-container",{"maxWidth":[4,"max-width"],"fullWidth":[4,"full-width"]}]]],["p-d86e3e82",[[1,"p-dropdown-menu-item",{"active":[4],"enableHover":[4,"enable-hover"],"icon":[1]}],[1,"p-dropdown",{"placement":[513],"strategy":[1],"show":[4],"calculateWidth":[4,"calculate-width"],"applyMaxWidth":[4,"apply-max-width"],"applyFullWidth":[4,"apply-full-width"],"insideClick":[4,"inside-click"],"disableTriggerClick":[4,"disable-trigger-click"],"chevronPosition":[1,"chevron-position"],"chevronDirection":[1,"chevron-direction"]},[[6,"click","documentClickHandler"]]]]],["p-4fc82528",[[1,"p-page-size-select",{"size":[1538],"sizeOptions":[16],"chevronPosition":[1,"chevron-position"],"buttonSize":[1,"button-size"],"buttonTemplate":[16],"itemTemplate":[16],"hidden":[4],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[0,"p-pagination",{"page":[1538],"pageSize":[2,"page-size"],"hideOnSinglePage":[4,"hide-on-single-page"],"total":[2]}],[1,"p-pagination-item",{"active":[4]}]]],["p-50789b59",[[1,"p-tooltip",{"variant":[1],"popover":[8],"placement":[1],"strategy":[1],"show":[4],"canManuallyClose":[4,"can-manually-close"]},[[2,"click","clickHandler"],[6,"click","documentClickHandler"],[1,"mouseenter","mouseEnterHandler"],[0,"focus","mouseEnterHandler"],[1,"mouseleave","mouseLeaveHandler"],[0,"blur","mouseLeaveHandler"]]]]],["p-23f04588",[[1,"p-input-group",{"size":[1],"prefix":[1],"suffix":[1],"icon":[1],"iconFlip":[1,"icon-flip"],"iconRotate":[2,"icon-rotate"],"iconPosition":[1,"icon-position"],"label":[1],"helper":[1],"required":[516],"error":[513],"disabled":[516],"focused":[516],"_forceShowTooltip":[32]},[[0,"focusin","handleFocusIn"],[0,"focusout","handleFocusOut"]]],[1,"p-helper",{"placement":[1]}],[1,"p-input-error",{"error":[1],"forceShowTooltip":[4,"force-show-tooltip"],"_showTooltip":[32]}]]],["p-bdaeb7c7",[[1,"p-table-header",{"quickFilters":[16],"activeQuickFilterIdentifier":[1,"active-quick-filter-identifier"],"loading":[4],"enableSearch":[4,"enable-search"],"itemsSelectedAmount":[2,"items-selected-amount"],"query":[1025],"enableFilter":[4,"enable-filter"],"selectedFiltersAmount":[2,"selected-filters-amount"],"filterButtonTemplate":[16],"enableEdit":[4,"enable-edit"],"canEdit":[1028,"can-edit"],"editButtonTemplate":[16],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[1,"p-table-footer",{"enablePageSize":[4,"enable-page-size"],"enablePagination":[4,"enable-pagination"],"enableExport":[4,"enable-export"],"loading":[4],"page":[1538],"total":[2],"pageSize":[2,"page-size"],"pageSizeOptions":[16],"hideOnSinglePage":[4,"hide-on-single-page"],"_locales":[32]},[[16,"localeChanged","_setLocales"]]],[4,"p-table-cell",{"variant":[1],"index":[2],"rowIndex":[2,"row-index"],"definition":[16],"item":[8],"value":[8],"checkbox":[8],"template":[16]}],[1,"p-table-row",{"variant":[1],"enableHover":[4,"enable-hover"]}],[0,"p-illustration",{"variant":[1]}],[1,"p-table-container"]]]]'),e)));
2
2
  //# sourceMappingURL=paperless.esm.js.map
@@ -12,6 +12,7 @@ const Select = class {
12
12
  index.registerInstance(this, hostRef);
13
13
  this.queryChange = index.createEvent(this, "queryChange", 7);
14
14
  this.valueChange = index.createEvent(this, "valueChange", 7);
15
+ this.dropdownShown = index.createEvent(this, "dropdownShown", 7);
15
16
  this._isAutoCompleting = false;
16
17
  this.items = undefined;
17
18
  this.icon = undefined;
@@ -105,6 +106,12 @@ const Select = class {
105
106
  itemChanges() {
106
107
  this._preselectItem();
107
108
  }
109
+ _showDropdownChanges() {
110
+ this.dropdownShown.emit({
111
+ value: this._showDropdown,
112
+ query: this.query,
113
+ });
114
+ }
108
115
  _preselectItem(value) {
109
116
  value = value === undefined ? null : value;
110
117
  const parsedValue = !!this.value
@@ -125,6 +132,9 @@ const Select = class {
125
132
  this._onBlur(true);
126
133
  }
127
134
  _onFocus() {
135
+ if (!this.items.length && !this.loading) {
136
+ return;
137
+ }
128
138
  if (!this.enableAutocomplete) {
129
139
  this._inputRef.blur();
130
140
  if (!this._showDropdown) {
@@ -177,7 +187,8 @@ const Select = class {
177
187
  get _el() { return index.getElement(this); }
178
188
  static get watchers() { return {
179
189
  "value": ["_valueChange"],
180
- "items": ["itemChanges"]
190
+ "items": ["itemChanges"],
191
+ "_showDropdown": ["_showDropdownChanges"]
181
192
  }; }
182
193
  };
183
194
  Select.style = selectComponentCss;
@@ -1 +1 @@
1
- {"file":"p-select.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,kBAAkB,GAAG,0yLAA0yL;;MCoBxzL,MAAM;;;;;IA4HP,sBAAiB,GAAY,KAAK,CAAC;;;;;;;sBA1Fd,MAAM;oBAKR,OAAO;;2BAUC,IAAI;uBAKR,IAAI;6BAKC,EAAE;8BAKA,IAAI;uBAKX,KAAK;mBAKT,KAAK;gBAeG,QAAQ;;;;;oBAyBE,KAAK;yBAOZ,KAAK;yBACL,IAAI;;EAM1C,IAAI,MAAM;;IACN,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE;MAC7B,OAAO,EAAE,CAAC;KACb;IAED,IAAI,KAAK,GACL,OAAO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a,GAAG,KAAK,CAAC;GAC9B;EAEO,SAAS,CAAC,EAAE;IAChB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;MACzB,OAAO;KACV;IAED,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;IAC7B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GACrC;EAEO,WAAW,CAAC,GAAG,EAAE,IAAI;;IACzB,QACI,CAAA,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAG,GAAG,CAAC,0CACL,QAAQ,EAAE,0CACV,WAAW,GACZ,OAAO,CAAC,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,EAAE,CAAC,KAAI,CAAC,EAC9C;GACL;EAEO,SAAS;IACb,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI;;MAAK,QAC7BF,kCACI,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EACtC,MAAM,EACF,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK,MAAA,IAAI,CAAC,aAAa,0CAAG,IAAI,CAAC,QAAQ,CAAC,CAAA,IAG9D,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CACH,EAC1B;KAAA,CAAC,CAAC;GACN;EAEO,gBAAgB;IACpB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OACjBA,kCAAsB,WAAW,EAAE,KAAK,IACpCA,sBAAU,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,oBAAoB,GAAG,CACpC,CAC1B,CAAC,CAAC;GACN;;;;;;;;;;;","names":["h","Host","childOf"],"sources":["./src/components/molecules/select/select.component.scss?tag=p-select","./src/components/molecules/select/select.component.tsx"],"sourcesContent":[":host {\n @apply flex flex-col;\n\n input.read-only {\n @apply text-ellipsis;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\n\n@Component({\n tag: 'p-select',\n styleUrl: 'select.component.scss',\n shadow: false,\n})\nexport class Select {\n /**\n * The items to show in the dropdown\n */\n @Prop() items: string | any[];\n\n /**\n * Icon of the select box\n */\n @Prop() icon: IconVariant;\n\n /**\n * The current query\n */\n @Prop() query: string;\n\n /**\n * The placeholder of the input\n */\n @Prop() placeholder: string;\n\n /**\n * The placeholder of the input when auto completing\n */\n @Prop() autocompletePlaceholder: string;\n\n /**\n * The current value\n */\n @Prop() value: any;\n\n /**\n * The key of the object to display\n */\n @Prop() displayKey: string = 'text';\n\n /**\n * The key of the object to return\n */\n @Prop() valueKey: string = 'value';\n\n /**\n * The key of the object to display\n */\n @Prop() queryKey?: string;\n\n /**\n * Wether to automatically select the first item\n */\n @Prop() autoSelectFirst: boolean = true;\n\n /**\n * Wether to show the chevron or not\n */\n @Prop() showChevron: boolean = true;\n\n /**\n * The maximum amount of items to display\n */\n @Prop() maxDisplayedItems: number = 10;\n\n /**\n * Wether to enable autocomplete\n */\n @Prop() enableAutocomplete: boolean = true;\n\n /**\n * Wether the input uses async filtering\n */\n @Prop() asyncFilter: boolean = false;\n\n /**\n * Wether to show loading items\n */\n @Prop() loading: boolean = false;\n\n /**\n * Event when the query of the autocomplete changes\n */\n @Event() queryChange: EventEmitter<string>;\n\n /**\n * Event when the value changes\n */\n @Event() valueChange: EventEmitter<any>;\n\n /**\n * The size of the input group used by the select\n */\n @Prop() size: 'small' | 'medium' = 'medium';\n\n /**\n * The prefix of the input group used by the select\n */\n @Prop() prefix: string;\n\n /**\n * The label of the input group used by the select\n */\n @Prop() label: string;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop() helper: string;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop({ reflect: true }) error: string;\n\n /**\n * Wether the input group is disabled used by the select\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n @State() private _showDropdown: any = false;\n @State() private _selectedItem: any = null;\n\n private _isAutoCompleting: boolean = false;\n\n private _inputRef: HTMLInputElement;\n\n get _items() {\n if (!this.items || this.loading) {\n return [];\n }\n\n let items =\n typeof this.items === 'string'\n ? JSON.parse(this.items)\n : this.items;\n\n if (typeof items?.[0] === 'string') {\n this.displayKey = 'text';\n this.valueKey = 'value';\n\n items = items.map((str) => ({\n value: str,\n text: str,\n }));\n }\n\n if (this._isAutoCompleting && this.query?.length && !this.asyncFilter) {\n items = items.filter((item) => {\n if (this.queryKey) {\n return this._checkvalue(this.queryKey, item);\n }\n\n return (\n this._checkvalue(this.valueKey, item) ||\n this._checkvalue(this.displayKey, item)\n );\n });\n }\n\n return items?.slice(0, this.maxDisplayedItems);\n }\n\n get _displayValue() {\n if (this._isAutoCompleting) {\n return this.query;\n }\n\n return this._selectedItem?.[this.displayKey];\n }\n\n get _placeholder() {\n return this._isAutoCompleting && this.autocompletePlaceholder?.length\n ? this.autocompletePlaceholder\n : this.placeholder;\n }\n\n componentDidLoad() {\n if (this.value) {\n this._valueChange(this.value);\n return;\n }\n\n if (this.autoSelectFirst) {\n this._selectedItem = this._items?.[0];\n }\n }\n\n render() {\n return (\n <Host class=\"p-select\">\n <p-dropdown\n disableTriggerClick={true}\n calculateWidth={true}\n insideClick={true}\n show={this._showDropdown}\n >\n <p-input-group\n slot=\"trigger\"\n icon={this.icon}\n size={this.size}\n prefix={this.prefix}\n label={this.label}\n helper={this.helper}\n error={this.error}\n disabled={this.disabled}\n focused={this._showDropdown}\n >\n <input\n slot=\"input\"\n type=\"text\"\n placeholder={this._placeholder}\n value={this._displayValue}\n class={`p-input cursor-pointer ${\n !this._isAutoCompleting && 'read-only'\n }`}\n onFocus={() => this._onFocus()}\n onMouseDown={(ev) => this._onMouseDown(ev)}\n onClick={() => this._onClick()}\n onInput={(ev) => this._onChange(ev)}\n ref={(ref) => (this._inputRef = ref)}\n />\n\n {this.showChevron && (\n <p-icon variant=\"chevron\" slot=\"suffix\" />\n )}\n </p-input-group>\n <div slot=\"items\">\n {this.loading\n ? this._getLoadingItems()\n : this._getItems()}\n </div>\n </p-dropdown>\n </Host>\n );\n }\n\n @Listen('click', { target: 'document', capture: true })\n protected documentClickHandler({ target }) {\n if (!this._showDropdown || childOf(target, this._el)) {\n return;\n }\n\n this._showDropdown = false;\n this._isAutoCompleting = false;\n }\n\n @Watch('value')\n private _valueChange(value: any) {\n this._preselectItem(value);\n }\n\n @Watch('items')\n public itemChanges() {\n this._preselectItem();\n }\n\n private _preselectItem(value?: any) {\n value = value === undefined ? null : value;\n const parsedValue = !!this.value\n ? JSON.stringify(this.value)\n : JSON.stringify(value);\n\n if (\n this._selectedItem &&\n JSON.stringify(this._selectedItem[this.valueKey]) === parsedValue\n ) {\n return;\n }\n\n const item = this._items.find(\n (i) => JSON.stringify(i?.[this.valueKey]) === parsedValue\n );\n\n this._selectedItem = item;\n }\n\n private _selectValue(item) {\n this._selectedItem = item;\n const value = item[this.valueKey];\n\n this.value = value;\n this.valueChange.emit(this.value);\n\n this._onBlur(true);\n }\n\n private _onFocus() {\n if (!this.enableAutocomplete) {\n this._inputRef.blur();\n if (!this._showDropdown) {\n this._showDropdown = true;\n }\n return;\n }\n\n this._isAutoCompleting = true;\n this._showDropdown = true;\n }\n\n private _onMouseDown(ev) {\n if (this.enableAutocomplete) {\n return;\n }\n\n ev.preventDefault();\n }\n\n private _onClick() {\n if (this.enableAutocomplete) {\n return;\n }\n\n this._showDropdown = !this._showDropdown;\n }\n\n private _onBlur(force = false) {\n if (!this.enableAutocomplete && !force) {\n return;\n }\n\n this._isAutoCompleting = false;\n this._showDropdown = false;\n }\n\n private _onChange(ev) {\n if (!this._isAutoCompleting) {\n return;\n }\n\n this.query = ev.target.value;\n this.queryChange.emit(this.query);\n }\n\n private _checkvalue(key, item) {\n return (\n item?.[key]\n ?.toString()\n ?.toLowerCase()\n .indexOf(this.query?.toLowerCase()) >= 0\n );\n }\n\n private _getItems() {\n return this._items.map((item) => (\n <p-dropdown-menu-item\n onClick={() => this._selectValue(item)}\n active={\n item[this.valueKey] === this._selectedItem?.[this.valueKey]\n }\n >\n {item[this.displayKey]}\n </p-dropdown-menu-item>\n ));\n }\n\n private _getLoadingItems() {\n return [0, 0, 0].map(() => (\n <p-dropdown-menu-item enableHover={false}>\n <p-loader variant=\"ghost\" class=\"h-6 w-full rounded\" />\n </p-dropdown-menu-item>\n ));\n }\n}\n"],"version":3}
1
+ {"file":"p-select.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,kBAAkB,GAAG,0yLAA0yL;;MCoBxzL,MAAM;;;;;;IAiIP,sBAAiB,GAAY,KAAK,CAAC;;;;;;;sBA/Fd,MAAM;oBAKR,OAAO;;2BAUC,IAAI;uBAKR,IAAI;6BAKC,EAAE;8BAKA,IAAI;uBAKX,KAAK;mBAKT,KAAK;gBAoBG,QAAQ;;;;;oBAyBE,KAAK;yBAOZ,KAAK;yBACL,IAAI;;EAM1C,IAAI,MAAM;;IACN,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE;MAC7B,OAAO,EAAE,CAAC;KACb;IAED,IAAI,KAAK,GACL,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;QACxB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC;IAErB,IAAI,QAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,CAAA,KAAK,QAAQ,EAAE;MAChC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;MACzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;MAExB,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;QACxB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,GAAG;OACZ,CAAC,CAAC,CA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,CAAC;IAC7B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GACrC;EAEO,WAAW,CAAC,GAAG,EAAE,IAAI;;IACzB,QACI,CAAA,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAG,GAAG,CAAC,0CACL,QAAQ,EAAE,0CACV,WAAW,GACZ,OAAO,CAAC,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,EAAE,CAAC,KAAI,CAAC,EAC9C;GACL;EAEO,SAAS;IACb,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI;;MAAK,QAC7BF,kCACI,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EACtC,MAAM,EACF,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAK,MAAA,IAAI,CAAC,aAAa,0CAAG,IAAI,CAAC,QAAQ,CAAC,CAAA,IAG9D,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CACH,EAC1B;KAAA,CAAC,CAAC;GACN;EAEO,gBAAgB;IACpB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OACjBA,kCAAsB,WAAW,EAAE,KAAK,IACpCA,sBAAU,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,oBAAoB,GAAG,CACpC,CAC1B,CAAC,CAAC;GACN;;;;;;;;;;;;","names":["h","Host","childOf"],"sources":["./src/components/molecules/select/select.component.scss?tag=p-select","./src/components/molecules/select/select.component.tsx"],"sourcesContent":[":host {\n @apply flex flex-col;\n\n input.read-only {\n @apply text-ellipsis;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\n\n@Component({\n tag: 'p-select',\n styleUrl: 'select.component.scss',\n shadow: false,\n})\nexport class Select {\n /**\n * The items to show in the dropdown\n */\n @Prop() items: string | any[];\n\n /**\n * Icon of the select box\n */\n @Prop() icon: IconVariant;\n\n /**\n * The current query\n */\n @Prop() query: string;\n\n /**\n * The placeholder of the input\n */\n @Prop() placeholder: string;\n\n /**\n * The placeholder of the input when auto completing\n */\n @Prop() autocompletePlaceholder: string;\n\n /**\n * The current value\n */\n @Prop() value: any;\n\n /**\n * The key of the object to display\n */\n @Prop() displayKey: string = 'text';\n\n /**\n * The key of the object to return\n */\n @Prop() valueKey: string = 'value';\n\n /**\n * The key of the object to display\n */\n @Prop() queryKey?: string;\n\n /**\n * Wether to automatically select the first item\n */\n @Prop() autoSelectFirst: boolean = true;\n\n /**\n * Wether to show the chevron or not\n */\n @Prop() showChevron: boolean = true;\n\n /**\n * The maximum amount of items to display\n */\n @Prop() maxDisplayedItems: number = 10;\n\n /**\n * Wether to enable autocomplete\n */\n @Prop() enableAutocomplete: boolean = true;\n\n /**\n * Wether the input uses async filtering\n */\n @Prop() asyncFilter: boolean = false;\n\n /**\n * Wether to show loading items\n */\n @Prop() loading: boolean = false;\n\n /**\n * Event when the query of the autocomplete changes\n */\n @Event() queryChange: EventEmitter<string>;\n\n /**\n * Event when the value changes\n */\n @Event() valueChange: EventEmitter<any>;\n\n /**\n * Event when the dropdown shows\n */\n @Event() dropdownShown: EventEmitter<any>;\n\n /**\n * The size of the input group used by the select\n */\n @Prop() size: 'small' | 'medium' = 'medium';\n\n /**\n * The prefix of the input group used by the select\n */\n @Prop() prefix: string;\n\n /**\n * The label of the input group used by the select\n */\n @Prop() label: string;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop() helper: string;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop({ reflect: true }) error: string;\n\n /**\n * Wether the input group is disabled used by the select\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n @State() private _showDropdown: any = false;\n @State() private _selectedItem: any = null;\n\n private _isAutoCompleting: boolean = false;\n\n private _inputRef: HTMLInputElement;\n\n get _items() {\n if (!this.items || this.loading) {\n return [];\n }\n\n let items =\n typeof this.items === 'string'\n ? JSON.parse(this.items)\n : this.items;\n\n if (typeof items?.[0] === 'string') {\n this.displayKey = 'text';\n this.valueKey = 'value';\n\n items = items.map((str) => ({\n value: str,\n text: str,\n }));\n }\n\n if (this._isAutoCompleting && this.query?.length && !this.asyncFilter) {\n items = items.filter((item) => {\n if (this.queryKey) {\n return this._checkvalue(this.queryKey, item);\n }\n\n return (\n this._checkvalue(this.valueKey, item) ||\n this._checkvalue(this.displayKey, item)\n );\n });\n }\n\n return items?.slice(0, this.maxDisplayedItems);\n }\n\n get _displayValue() {\n if (this._isAutoCompleting) {\n return this.query;\n }\n\n return this._selectedItem?.[this.displayKey];\n }\n\n get _placeholder() {\n return this._isAutoCompleting && this.autocompletePlaceholder?.length\n ? this.autocompletePlaceholder\n : this.placeholder;\n }\n\n componentDidLoad() {\n if (this.value) {\n this._valueChange(this.value);\n return;\n }\n\n if (this.autoSelectFirst) {\n this._selectedItem = this._items?.[0];\n }\n }\n\n render() {\n return (\n <Host class=\"p-select\">\n <p-dropdown\n disableTriggerClick={true}\n calculateWidth={true}\n insideClick={true}\n show={this._showDropdown}\n >\n <p-input-group\n slot=\"trigger\"\n icon={this.icon}\n size={this.size}\n prefix={this.prefix}\n label={this.label}\n helper={this.helper}\n error={this.error}\n disabled={this.disabled}\n focused={this._showDropdown}\n >\n <input\n slot=\"input\"\n type=\"text\"\n placeholder={this._placeholder}\n value={this._displayValue}\n class={`p-input cursor-pointer ${\n !this._isAutoCompleting && 'read-only'\n }`}\n onFocus={() => this._onFocus()}\n onMouseDown={(ev) => this._onMouseDown(ev)}\n onClick={() => this._onClick()}\n onInput={(ev) => this._onChange(ev)}\n ref={(ref) => (this._inputRef = ref)}\n />\n\n {this.showChevron && (\n <p-icon variant=\"chevron\" slot=\"suffix\" />\n )}\n </p-input-group>\n <div slot=\"items\">\n {this.loading\n ? this._getLoadingItems()\n : this._getItems()}\n </div>\n </p-dropdown>\n </Host>\n );\n }\n\n @Listen('click', { target: 'document', capture: true })\n protected documentClickHandler({ target }) {\n if (!this._showDropdown || childOf(target, this._el)) {\n return;\n }\n\n this._showDropdown = false;\n this._isAutoCompleting = false;\n }\n\n @Watch('value')\n private _valueChange(value: any) {\n this._preselectItem(value);\n }\n\n @Watch('items')\n public itemChanges() {\n this._preselectItem();\n }\n\n @Watch('_showDropdown')\n public _showDropdownChanges() {\n this.dropdownShown.emit({\n value: this._showDropdown,\n query: this.query,\n });\n }\n\n private _preselectItem(value?: any) {\n value = value === undefined ? null : value;\n const parsedValue = !!this.value\n ? JSON.stringify(this.value)\n : JSON.stringify(value);\n\n if (\n this._selectedItem &&\n JSON.stringify(this._selectedItem[this.valueKey]) === parsedValue\n ) {\n return;\n }\n\n const item = this._items.find(\n (i) => JSON.stringify(i?.[this.valueKey]) === parsedValue\n );\n\n this._selectedItem = item;\n }\n\n private _selectValue(item) {\n this._selectedItem = item;\n const value = item[this.valueKey];\n\n this.value = value;\n this.valueChange.emit(this.value);\n\n this._onBlur(true);\n }\n\n private _onFocus() {\n if (!this.items.length && !this.loading) {\n return;\n }\n\n if (!this.enableAutocomplete) {\n this._inputRef.blur();\n if (!this._showDropdown) {\n this._showDropdown = true;\n }\n return;\n }\n\n this._isAutoCompleting = true;\n this._showDropdown = true;\n }\n\n private _onMouseDown(ev) {\n if (this.enableAutocomplete) {\n return;\n }\n\n ev.preventDefault();\n }\n\n private _onClick() {\n if (this.enableAutocomplete) {\n return;\n }\n\n this._showDropdown = !this._showDropdown;\n }\n\n private _onBlur(force = false) {\n if (!this.enableAutocomplete && !force) {\n return;\n }\n\n this._isAutoCompleting = false;\n this._showDropdown = false;\n }\n\n private _onChange(ev) {\n if (!this._isAutoCompleting) {\n return;\n }\n\n this.query = ev.target.value;\n this.queryChange.emit(this.query);\n }\n\n private _checkvalue(key, item) {\n return (\n item?.[key]\n ?.toString()\n ?.toLowerCase()\n .indexOf(this.query?.toLowerCase()) >= 0\n );\n }\n\n private _getItems() {\n return this._items.map((item) => (\n <p-dropdown-menu-item\n onClick={() => this._selectValue(item)}\n active={\n item[this.valueKey] === this._selectedItem?.[this.valueKey]\n }\n >\n {item[this.displayKey]}\n </p-dropdown-menu-item>\n ));\n }\n\n private _getLoadingItems() {\n return [0, 0, 0].map(() => (\n <p-dropdown-menu-item enableHover={false}>\n <p-loader variant=\"ghost\" class=\"h-6 w-full rounded\" />\n </p-dropdown-menu-item>\n ));\n }\n}\n"],"version":3}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-19716b9c.js');
6
6
 
7
- const stepperItemComponentCss = ".static{position:static!important}.absolute{position:absolute!important}.relative{position:relative!important}.left-1{left:.25rem!important}.order-2{order:2!important}.ml-0{margin-left:0!important}.mr-4{margin-right:1rem!important}.flex{display:flex!important}.h-4{height:1rem!important}.w-4{width:1rem!important}.min-w-0{min-width:0!important}.-translate-x-1{--tw-translate-x:-0.25rem!important}.-rotate-0,.-translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-0{--tw-rotate:-0deg!important}.-rotate-135{--tw-rotate:-135deg!important}.-rotate-135,.-rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-180{--tw-rotate:-180deg!important}.-rotate-225{--tw-rotate:-225deg!important}.-rotate-225,.-rotate-25{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-25{--tw-rotate:-25deg!important}.-rotate-270{--tw-rotate:-270deg!important}.-rotate-270,.-rotate-315{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-315{--tw-rotate:-315deg!important}.-rotate-45{--tw-rotate:-45deg!important}.-rotate-45,.-rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-90{--tw-rotate:-90deg!important}.rotate-0{--tw-rotate:0deg!important}.rotate-0,.rotate-135{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-135{--tw-rotate:135deg!important}.rotate-180{--tw-rotate:180deg!important}.rotate-180,.rotate-225{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-225{--tw-rotate:225deg!important}.rotate-25{--tw-rotate:25deg!important}.rotate-25,.rotate-270{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-270{--tw-rotate:270deg!important}.rotate-315{--tw-rotate:315deg!important}.rotate-315,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-45{--tw-rotate:45deg!important}.rotate-90{--tw-rotate:90deg!important}.rotate-90,.scale-x-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.scale-x-flip{--tw-scale-x:-1!important}.scale-y-flip{--tw-scale-y:-1!important}.scale-y-flip,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.bg-mystic-dark{--tw-bg-opacity:1!important;background-color:rgb(218 230 240/var(--tw-bg-opacity))!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important}.text-5xl,.text-6xl{line-height:1!important}.text-6xl{font-size:3.75rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.text-xxs{font-size:.6875rem!important}.font-semibold{font-weight:600!important}.transition{transition-duration:.15s!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.duration-500{transition-duration:.5s!important}*{box-sizing:border-box}.left-1\\/2{left:50%!important}.min-h-\\[1rem\\]{min-height:1rem!important}.-translate-x-1\\/2{--tw-translate-x:-50%!important}.-translate-x-1\\/2,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}:host{align-items:flex-end;display:flex;justify-content:center;position:relative}:host .content{--tw-text-opacity:1;color:rgb(176 178 203/var(--tw-text-opacity));font-size:.875rem;font-weight:600;line-height:1.25rem;min-width:0;white-space:nowrap}:host .circle{--tw-bg-opacity:1;--tw-text-opacity:1;align-items:center;background-color:rgb(218 230 240/var(--tw-bg-opacity));border-radius:100%;color:rgb(255 255 255/var(--tw-text-opacity));display:flex;height:1rem;justify-content:center;transition-duration:.5s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);width:1rem}:host .circle p-icon{display:flex!important;font-size:.625rem}:host([direction=horizontal]){height:2.5rem}:host([direction=horizontal]) .content{order:1;position:absolute;top:0}:host([direction=horizontal]) .circle{order:2}:host([direction=vertical]){align-items:center;min-height:1rem}:host([direction=vertical]) .content{margin-left:1rem;order:2}:host([direction=vertical]) .circle{order:1}:host([active]) .content,:host([finished]) .content{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}:host([active]) .circle,:host([finished]) .circle{--tw-bg-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity))}:host([direction=horizontal][align=start]) .content{left:0}:host([direction=horizontal][align=end]) .content{right:0}:host([direction=horizontal][align=center]) .content{--tw-translate-x:-50%;left:50%;text-align:center;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host([direction=vertical][content-position=start]){flex-direction:row-reverse}:host([direction=vertical][content-position=start]) .content{display:flex;justify-content:flex-end;margin-left:0;margin-right:1rem}.-rotate-0,.-rotate-135,.-rotate-180,.-rotate-225,.-rotate-25,.-rotate-270,.-rotate-315,.-rotate-45,.-rotate-90,.rotate-0,.rotate-135,.rotate-180,.rotate-225,.rotate-25,.rotate-270,.rotate-315,.rotate-45,.rotate-90,.scale-x-flip,.scale-y-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.text-lg,.text-xl{line-height:1.75rem!important}.-rotate-0,.-rotate-135,.-rotate-180,.-rotate-225,.-rotate-25,.-rotate-270,.-rotate-315,.-rotate-45,.-rotate-90,.rotate-0,.rotate-135,.rotate-180,.rotate-225,.rotate-25,.rotate-270,.rotate-315,.rotate-45,.rotate-90,.scale-x-flip,.scale-y-flip,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}";
7
+ const stepperItemComponentCss = ".static{position:static!important}.absolute{position:absolute!important}.relative{position:relative!important}.left-1{left:.25rem!important}.order-2{order:2!important}.ml-0{margin-left:0!important}.mr-4{margin-right:1rem!important}.flex{display:flex!important}.h-4{height:1rem!important}.w-4{width:1rem!important}.min-w-0{min-width:0!important}.-translate-x-1{--tw-translate-x:-0.25rem!important}.-rotate-0,.-translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-0{--tw-rotate:-0deg!important}.-rotate-135{--tw-rotate:-135deg!important}.-rotate-135,.-rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-180{--tw-rotate:-180deg!important}.-rotate-225{--tw-rotate:-225deg!important}.-rotate-225,.-rotate-25{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-25{--tw-rotate:-25deg!important}.-rotate-270{--tw-rotate:-270deg!important}.-rotate-270,.-rotate-315{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-315{--tw-rotate:-315deg!important}.-rotate-45{--tw-rotate:-45deg!important}.-rotate-45,.-rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-rotate-90{--tw-rotate:-90deg!important}.rotate-0{--tw-rotate:0deg!important}.rotate-0,.rotate-135{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-135{--tw-rotate:135deg!important}.rotate-180{--tw-rotate:180deg!important}.rotate-180,.rotate-225{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-225{--tw-rotate:225deg!important}.rotate-25{--tw-rotate:25deg!important}.rotate-25,.rotate-270{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-270{--tw-rotate:270deg!important}.rotate-315{--tw-rotate:315deg!important}.rotate-315,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.rotate-45{--tw-rotate:45deg!important}.rotate-90{--tw-rotate:90deg!important}.rotate-90,.scale-x-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.scale-x-flip{--tw-scale-x:-1!important}.scale-y-flip{--tw-scale-y:-1!important}.scale-y-flip,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.bg-mystic-dark{--tw-bg-opacity:1!important;background-color:rgb(218 230 240/var(--tw-bg-opacity))!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important}.text-5xl,.text-6xl{line-height:1!important}.text-6xl{font-size:3.75rem!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.text-xxs{font-size:.6875rem!important}.transition{transition-duration:.15s!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.duration-500{transition-duration:.5s!important}*{box-sizing:border-box}.left-1\\/2{left:50%!important}.min-h-\\[1rem\\]{min-height:1rem!important}.-translate-x-1\\/2{--tw-translate-x:-50%!important}.-translate-x-1\\/2,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}:host{align-items:flex-end;display:flex;justify-content:center;position:relative}:host .content{--tw-text-opacity:1;color:rgb(176 178 203/var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem;min-width:0;white-space:nowrap}:host .circle{--tw-bg-opacity:1;--tw-text-opacity:1;align-items:center;background-color:rgb(218 230 240/var(--tw-bg-opacity));border-radius:100%;color:rgb(255 255 255/var(--tw-text-opacity));display:flex;height:1rem;justify-content:center;transition-duration:.5s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);width:1rem}:host .circle p-icon{display:flex!important;font-size:.625rem}:host([direction=horizontal]){height:2.5rem}:host([direction=horizontal]) .content{order:1;position:absolute;top:0}:host([direction=horizontal]) .circle{order:2}:host([direction=vertical]){align-items:center;min-height:1rem}:host([direction=vertical]) .content{margin-left:1rem;order:2}:host([direction=vertical]) .circle{order:1}:host([active]) .content,:host([finished]) .content{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}:host([active]) .circle,:host([finished]) .circle{--tw-bg-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity))}:host([direction=horizontal][align=start]) .content{left:0}:host([direction=horizontal][align=end]) .content{right:0}:host([direction=horizontal][align=center]) .content{--tw-translate-x:-50%;left:50%;text-align:center;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host([direction=vertical][content-position=start]){flex-direction:row-reverse}:host([direction=vertical][content-position=start]) .content{display:flex;justify-content:flex-end;margin-left:0;margin-right:1rem}.-rotate-0,.-rotate-135,.-rotate-180,.-rotate-225,.-rotate-25,.-rotate-270,.-rotate-315,.-rotate-45,.-rotate-90,.rotate-0,.rotate-135,.rotate-180,.rotate-225,.rotate-25,.rotate-270,.rotate-315,.rotate-45,.rotate-90,.scale-x-flip,.scale-y-flip{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.text-lg,.text-xl{line-height:1.75rem!important}.-rotate-0,.-rotate-135,.-rotate-180,.-rotate-225,.-rotate-25,.-rotate-270,.-rotate-315,.-rotate-45,.-rotate-90,.rotate-0,.rotate-135,.rotate-180,.rotate-225,.rotate-25,.rotate-270,.rotate-315,.rotate-45,.rotate-90,.scale-x-flip,.scale-y-flip,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}";
8
8
 
9
9
  const StepperItem = class {
10
10
  constructor(hostRef) {
@@ -1 +1 @@
1
- {"file":"p-stepper-item.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,uBAAuB,GAAG,wpRAAwpR;;MCO3qR,WAAW;;;iBAIyC,QAAQ;qBAMjE,YAAY;2BAK4C,KAAK;oBAKpB,KAAK;kBAKP,KAAK;;EAEhD,MAAM;IACF,QACIA,QAACC,UAAI,IAAC,KAAK,EAAC,gBAAgB,IACxBD,iBAAK,KAAK,EAAC,SAAS,IAChBA,kBAAM,IAAI,EAAC,SAAS,GAAG,CACrB,EACNA,iBAAK,KAAK,EAAC,QAAQ,IACd,IAAI,CAAC,QAAQ,IAAIA,oBAAQ,OAAO,EAAC,WAAW,GAAG,CAC9C,CACH,EACT;GACL;;;;;;","names":["h","Host"],"sources":["./src/components/atoms/stepper-item/stepper-item.component.scss?tag=p-stepper-item&encapsulation=shadow","./src/components/atoms/stepper-item/stepper-item.component.tsx"],"sourcesContent":[":host {\n @apply relative flex items-end justify-center;\n\n .content {\n @apply min-w-0 whitespace-nowrap;\n @apply text-sm font-semibold text-storm-light;\n }\n\n .circle {\n @apply transition duration-500 ease-in-out;\n @apply flex items-center justify-center;\n @apply h-4 w-4 rounded-round;\n @apply bg-mystic-dark text-white;\n\n p-icon {\n @apply flex #{!important};\n font-size: 0.625rem;\n }\n }\n}\n\n:host([direction='horizontal']) {\n @apply h-10;\n\n .content {\n @apply absolute top-0;\n @apply order-1;\n }\n\n .circle {\n @apply order-2;\n }\n}\n\n:host([direction='vertical']) {\n @apply min-h-[1rem] items-center;\n\n .content {\n @apply order-2 ml-4;\n }\n\n .circle {\n @apply order-1;\n }\n}\n\n:host([active]),\n:host([finished]) {\n .content {\n @apply text-indigo;\n }\n\n .circle {\n @apply bg-indigo;\n }\n}\n\n:host([direction='horizontal'][align='start']) {\n .content {\n @apply left-0;\n }\n}\n\n:host([direction='horizontal'][align='end']) {\n .content {\n @apply right-0;\n }\n}\n\n:host([direction='horizontal'][align='center']) {\n .content {\n @apply left-1/2 -translate-x-1/2 transform text-center;\n }\n}\n\n:host([direction='vertical'][content-position='start']) {\n @apply flex-row-reverse;\n\n .content {\n @apply ml-0 mr-4 flex justify-end;\n }\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'p-stepper-item',\n styleUrl: 'stepper-item.component.scss',\n shadow: true,\n})\nexport class StepperItem {\n /**\n * The alignment of the step content\n */\n @Prop({ reflect: true }) align: 'start' | 'center' | 'end' = 'center';\n\n /**\n * The direction of the stepper step\n */\n @Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n 'horizontal';\n\n /**\n * The position of the content in case of vertical direction\n */\n @Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n /**\n * Wether the step is finished\n */\n @Prop({ reflect: true }) finished: boolean = false;\n\n /**\n * Wether the step is active\n */\n @Prop({ reflect: true }) active: boolean = false;\n\n render() {\n return (\n <Host class=\"p-stepper-item\">\n <div class=\"content\">\n <slot name=\"content\" />\n </div>\n <div class=\"circle\">\n {this.finished && <p-icon variant=\"checkmark\" />}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-stepper-item.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,uBAAuB,GAAG,+lRAA+lR;;MCOlnR,WAAW;;;iBAIyC,QAAQ;qBAMjE,YAAY;2BAK4C,KAAK;oBAKpB,KAAK;kBAKP,KAAK;;EAEhD,MAAM;IACF,QACIA,QAACC,UAAI,IAAC,KAAK,EAAC,gBAAgB,IACxBD,iBAAK,KAAK,EAAC,SAAS,IAChBA,kBAAM,IAAI,EAAC,SAAS,GAAG,CACrB,EACNA,iBAAK,KAAK,EAAC,QAAQ,IACd,IAAI,CAAC,QAAQ,IAAIA,oBAAQ,OAAO,EAAC,WAAW,GAAG,CAC9C,CACH,EACT;GACL;;;;;;","names":["h","Host"],"sources":["./src/components/atoms/stepper-item/stepper-item.component.scss?tag=p-stepper-item&encapsulation=shadow","./src/components/atoms/stepper-item/stepper-item.component.tsx"],"sourcesContent":[":host {\n @apply relative flex items-end justify-center;\n\n .content {\n @apply min-w-0 whitespace-nowrap;\n @apply text-sm text-storm-light;\n }\n\n .circle {\n @apply transition duration-500 ease-in-out;\n @apply flex items-center justify-center;\n @apply h-4 w-4 rounded-round;\n @apply bg-mystic-dark text-white;\n\n p-icon {\n @apply flex #{!important};\n font-size: 0.625rem;\n }\n }\n}\n\n:host([direction='horizontal']) {\n @apply h-10;\n\n .content {\n @apply absolute top-0;\n @apply order-1;\n }\n\n .circle {\n @apply order-2;\n }\n}\n\n:host([direction='vertical']) {\n @apply min-h-[1rem] items-center;\n\n .content {\n @apply order-2 ml-4;\n }\n\n .circle {\n @apply order-1;\n }\n}\n\n:host([active]),\n:host([finished]) {\n .content {\n @apply text-indigo;\n }\n\n .circle {\n @apply bg-indigo;\n }\n}\n\n:host([direction='horizontal'][align='start']) {\n .content {\n @apply left-0;\n }\n}\n\n:host([direction='horizontal'][align='end']) {\n .content {\n @apply right-0;\n }\n}\n\n:host([direction='horizontal'][align='center']) {\n .content {\n @apply left-1/2 -translate-x-1/2 transform text-center;\n }\n}\n\n:host([direction='vertical'][content-position='start']) {\n @apply flex-row-reverse;\n\n .content {\n @apply ml-0 mr-4 flex justify-end;\n }\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'p-stepper-item',\n styleUrl: 'stepper-item.component.scss',\n shadow: true,\n})\nexport class StepperItem {\n /**\n * The alignment of the step content\n */\n @Prop({ reflect: true }) align: 'start' | 'center' | 'end' = 'center';\n\n /**\n * The direction of the stepper step\n */\n @Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n 'horizontal';\n\n /**\n * The position of the content in case of vertical direction\n */\n @Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n /**\n * Wether the step is finished\n */\n @Prop({ reflect: true }) finished: boolean = false;\n\n /**\n * Wether the step is active\n */\n @Prop({ reflect: true }) active: boolean = false;\n\n render() {\n return (\n <Host class=\"p-stepper-item\">\n <div class=\"content\">\n <slot name=\"content\" />\n </div>\n <div class=\"circle\">\n {this.finished && <p-icon variant=\"checkmark\" />}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -14,45 +14,64 @@ const Stepper = class {
14
14
  this.contentPosition = 'end';
15
15
  }
16
16
  // private _steps: Array<HTMLPStepperItemElement>;
17
- componentDidLoad() {
18
- const activeStep = this.activeStep - 1;
19
- this._generateSteps(activeStep);
17
+ componentDidRender() {
18
+ this._generateSteps();
20
19
  }
21
20
  render() {
22
21
  return (index.h(index.Host, { class: "p-stepper" }, index.h("slot", null)));
23
22
  }
24
- _generateSteps(activeStep) {
25
- const items = this._el.querySelectorAll('p-stepper-item');
23
+ _generateSteps() {
24
+ let activeStep = this.activeStep - 1;
25
+ const items = this._el.querySelectorAll('p-stepper-item, p-stepper-line');
26
+ if (!!this.activeStep || activeStep <= 0) {
27
+ const arrayItems = Array.from(items);
28
+ const activeItemIndex = arrayItems.findIndex((i) => i.tagName.toLowerCase() === 'p-stepper-item' &&
29
+ i.active &&
30
+ !i.finished);
31
+ if (activeItemIndex >= 0) {
32
+ activeStep = activeItemIndex;
33
+ }
34
+ const finishedItemIndex = arrayItems.findIndex((i) => i.tagName.toLowerCase() === 'p-stepper-item' && i.finished);
35
+ if (activeStep <= 0 && finishedItemIndex >= 0) {
36
+ activeStep = finishedItemIndex + 1;
37
+ }
38
+ }
26
39
  for (let i = 0; i < (items === null || items === void 0 ? void 0 : items.length); i++) {
27
40
  const item = items.item(i);
28
- item.active = i === activeStep;
29
- item.finished = i < activeStep;
30
- item.direction = this.direction;
31
- item.align =
32
- i === 0 ? 'start' : i === (items === null || items === void 0 ? void 0 : items.length) - 1 ? 'end' : 'center';
33
- item.contentPosition = this.contentPosition;
34
- const heightDiff = (item.clientHeight - 16) / 2;
35
- if (i > 0) {
36
- const stepperLine = document.createElement('p-stepper-line');
37
- stepperLine.direction = this.direction;
38
- stepperLine.active = i <= activeStep;
39
- if (heightDiff > 0 && this.direction === 'vertical') {
40
- stepperLine.style.marginTop = `-${heightDiff / 16}rem`;
41
- stepperLine.style.marginBottom = `-${heightDiff / 16}rem`;
42
- stepperLine.style.minHeight = `calc(1rem + ${(heightDiff * 2) / 16}rem)`;
41
+ if (item.tagName.toLowerCase() === 'p-stepper-item') {
42
+ item.active = i === activeStep;
43
+ item.finished = i < activeStep;
44
+ item.direction = this.direction;
45
+ item.align =
46
+ i === 0
47
+ ? 'start'
48
+ : i === (items === null || items === void 0 ? void 0 : items.length) - 1
49
+ ? 'end'
50
+ : 'center';
51
+ item.contentPosition = this.contentPosition;
52
+ if (i > 0) {
53
+ const nextItem = items.item(i + 1);
54
+ if (!nextItem ||
55
+ nextItem.tagName.toLowerCase() === 'p-stepper-item') {
56
+ const heightDiff = (item.clientHeight - 16) / 2;
57
+ const stepperLine = document.createElement('p-stepper-line');
58
+ stepperLine.direction = this.direction;
59
+ stepperLine.active = i <= activeStep;
60
+ if (heightDiff > 0 && this.direction === 'vertical') {
61
+ stepperLine.style.marginTop = `-${heightDiff / 16}rem`;
62
+ stepperLine.style.marginBottom = `-${heightDiff / 16}rem`;
63
+ stepperLine.style.minHeight = `calc(1rem + ${(heightDiff * 2) / 16}rem)`;
64
+ }
65
+ this._el.insertBefore(stepperLine, item);
66
+ continue;
67
+ }
68
+ if (nextItem.tagName.toLowerCase() === 'p-stepper-line') {
69
+ nextItem.direction = this.direction;
70
+ nextItem.active = i <= activeStep;
71
+ }
43
72
  }
44
- this._el.insertBefore(stepperLine, item);
45
73
  }
46
- // const child = item.querySelector('[slot="content"]');
47
- // const newItem = (
48
- // <p-stepper-item
49
- // >
50
- // <div slot="content" innerHTML={child.outerHTML} />
51
- // </p-stepper-item>
52
- // );
53
- // elements.push(newItem);
54
74
  }
55
- // return elements;
56
75
  }
57
76
  get _el() { return index.getElement(this); }
58
77
  };