@postnord/pn-marketweb-components 3.3.3 → 3.3.5

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 (66) hide show
  1. package/cjs/pn-charts-card.cjs.entry.js +1 -1
  2. package/cjs/pn-charts-card.cjs.entry.js.map +1 -1
  3. package/cjs/pn-date-and-time.cjs.entry.js +19 -12
  4. package/cjs/pn-date-and-time.cjs.entry.js.map +1 -1
  5. package/cjs/pn-dropdown-with-multi-input-rows-row.cjs.entry.js +2 -2
  6. package/cjs/pn-dropdown-with-multi-input-rows-row.cjs.entry.js.map +1 -1
  7. package/cjs/pn-dropdown-with-multi-input-rows.cjs.entry.js +20 -19
  8. package/cjs/pn-dropdown-with-multi-input-rows.cjs.entry.js.map +1 -1
  9. package/cjs/pn-marketweb-siteheader-login-linklist.cjs.entry.js +2 -2
  10. package/cjs/pn-marketweb-siteheader-login-linklist.cjs.entry.js.map +1 -1
  11. package/collection/components/charts/pn-charts-card/pn-charts-card.js +1 -1
  12. package/collection/components/charts/pn-charts-card/pn-charts-card.js.map +1 -1
  13. package/collection/components/input/pn-date-and-time/pn-date-and-time.js +19 -12
  14. package/collection/components/input/pn-date-and-time/pn-date-and-time.js.map +1 -1
  15. package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.js +2 -2
  16. package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.js.map +1 -1
  17. package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.js +20 -19
  18. package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.js.map +1 -1
  19. package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.stories.js +1 -1
  20. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.css +5 -0
  21. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.js +1 -1
  22. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.js.map +1 -1
  23. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js +23 -0
  24. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js.map +1 -1
  25. package/components/pn-charts-card.js +1 -1
  26. package/components/pn-charts-card.js.map +1 -1
  27. package/components/pn-date-and-time.js +19 -12
  28. package/components/pn-date-and-time.js.map +1 -1
  29. package/components/pn-dropdown-with-multi-input-rows-row2.js +2 -2
  30. package/components/pn-dropdown-with-multi-input-rows-row2.js.map +1 -1
  31. package/components/pn-dropdown-with-multi-input-rows.js +20 -19
  32. package/components/pn-dropdown-with-multi-input-rows.js.map +1 -1
  33. package/components/pn-marketweb-siteheader-login-linklist2.js +2 -2
  34. package/components/pn-marketweb-siteheader-login-linklist2.js.map +1 -1
  35. package/esm/pn-charts-card.entry.js +1 -1
  36. package/esm/pn-charts-card.entry.js.map +1 -1
  37. package/esm/pn-date-and-time.entry.js +19 -12
  38. package/esm/pn-date-and-time.entry.js.map +1 -1
  39. package/esm/pn-dropdown-with-multi-input-rows-row.entry.js +2 -2
  40. package/esm/pn-dropdown-with-multi-input-rows-row.entry.js.map +1 -1
  41. package/esm/pn-dropdown-with-multi-input-rows.entry.js +21 -20
  42. package/esm/pn-dropdown-with-multi-input-rows.entry.js.map +1 -1
  43. package/esm/pn-marketweb-siteheader-login-linklist.entry.js +2 -2
  44. package/esm/pn-marketweb-siteheader-login-linklist.entry.js.map +1 -1
  45. package/package.json +1 -1
  46. package/pn-market-web-components/p-27be422f.entry.js +2 -0
  47. package/pn-market-web-components/p-27be422f.entry.js.map +1 -0
  48. package/pn-market-web-components/{p-d40ff187.entry.js → p-5845b81b.entry.js} +2 -2
  49. package/pn-market-web-components/p-5845b81b.entry.js.map +1 -0
  50. package/pn-market-web-components/p-85f1e4c3.entry.js +2 -0
  51. package/pn-market-web-components/p-85f1e4c3.entry.js.map +1 -0
  52. package/pn-market-web-components/{p-190c671b.entry.js → p-a8618acd.entry.js} +2 -2
  53. package/pn-market-web-components/{p-190c671b.entry.js.map → p-a8618acd.entry.js.map} +1 -1
  54. package/pn-market-web-components/p-bdaf4338.entry.js +2 -0
  55. package/pn-market-web-components/p-bdaf4338.entry.js.map +1 -0
  56. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  57. package/types/components/input/pn-date-and-time/pn-date-and-time.d.ts +0 -1
  58. package/types/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.d.ts +1 -0
  59. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.d.ts +1 -0
  60. package/pn-market-web-components/p-781ef432.entry.js +0 -2
  61. package/pn-market-web-components/p-781ef432.entry.js.map +0 -1
  62. package/pn-market-web-components/p-b2dcce7c.entry.js +0 -2
  63. package/pn-market-web-components/p-b2dcce7c.entry.js.map +0 -1
  64. package/pn-market-web-components/p-d40ff187.entry.js.map +0 -1
  65. package/pn-market-web-components/p-d8a57eba.entry.js +0 -2
  66. package/pn-market-web-components/p-d8a57eba.entry.js.map +0 -1
@@ -28,7 +28,7 @@ const PnChartsCard = class {
28
28
  return null;
29
29
  };
30
30
  render() {
31
- return (index.h(index.Host, { key: '91447ac4f3c66c65a9c32357d1c15819529a47bf' }, index.h("slot", { key: '885766168316b0126bfd4bbc0fa6831d50271ac8', name: "clickable-block-wrapper" }), index.h("div", { key: 'c36f6da932a19fdf26331695fcff8f980ba9717f', class: "pn-charts-card__wrapper" }, index.h("div", { key: '21a27ad5df39c1d7c410dd303f8d15d0e57e6a97', class: "pn-charts-card__heading__wrapper pn-charts-card__heading__wrapper--vertical" }, index.h("div", { key: '78a02d58749721eb9a7d3ff5cf5850051e6db6c3', class: "pn-charts-card__heading" }, this.header), index.h("div", { key: '86e37c66d1bc07b116880ed67631e379cda81794', class: "pn-charts-card__heading__highlight" }, this.highlight)), index.h("div", { key: '7be12f544ea812646e80e7f77bbfc235b92a1d57', class: "pn-charts-card__content__wrapper" }, index.h("slot", { key: '22cf9818c897929d08ffa732a487600c7c45d4f4', name: "chart" }), index.h("div", { key: '3b04e1a9cf180090e2cdb43e6c61c8201ece9f7c', class: "pn-charts-card__text__container" }, index.h("div", { key: '7f6b7a798ae08286bb35e7938c3f6c78176f2c6c', class: "pn-charts-card__heading__wrapper pn-charts-card__heading__wrapper--horizontal" }, index.h("div", { key: 'a1048bbf22cd5cf3efb0d2a3e6d689166ce2b45e', class: "pn-charts-card__heading pn-charts-card__heading" }, this.header), index.h("div", { key: 'd4e8d1cf6e9f1242267d811ab72dd3cee8d74b86', class: "pn-charts-card__heading__highlight" }, this.highlight)), index.h("span", { key: 'ab93adf62d319525a0f46bbabf4f0cc5bd1a6291', class: "pn-charts-card__preamble" }, this.preamble), index.h("div", { key: 'e13eb63ad552134988650123c26293ad3507a312', class: "pn-charts-card__text__wrapper" }, index.h("div", { key: '64901e491a8b7de6adfa60e04d39d13dc9b17551', class: "pn-charts-card__source" }, index.h("label", { key: '2857102340c025aaf5a6f6229a29f3e5a76a3757' }, this.label), index.h("h3", { key: 'ebb5f05098fd21bc6da23e9aac3b0ba188404096', class: "pn-chart-card__text__heading" }, this.source), this.showCtaLinkText())))))));
31
+ return (index.h(index.Host, { key: '91447ac4f3c66c65a9c32357d1c15819529a47bf' }, index.h("slot", { key: '885766168316b0126bfd4bbc0fa6831d50271ac8', name: "clickable-block-wrapper" }), index.h("div", { key: 'c36f6da932a19fdf26331695fcff8f980ba9717f', class: "pn-charts-card__wrapper" }, index.h("div", { key: '21a27ad5df39c1d7c410dd303f8d15d0e57e6a97', class: "pn-charts-card__heading__wrapper pn-charts-card__heading__wrapper--vertical" }, index.h("h2", { key: 'e962cd70401a2d5f7803eff1dfe6f8103914b7c0', class: "pn-charts-card__heading" }, this.header), index.h("div", { key: '9d48c7554a1aaa1335f56e9bd854d6735dcaebdf', class: "pn-charts-card__heading__highlight" }, this.highlight)), index.h("div", { key: '0c9cdd7bb51cdf330cff3c1dbfc0d2c9bdcf3f37', class: "pn-charts-card__content__wrapper" }, index.h("slot", { key: '50760aa3a8451a10761bd5aa7494c87d6ee98d37', name: "chart" }), index.h("div", { key: 'b29621773e2b57bf11b1918b5db6cf6bcbc9f70b', class: "pn-charts-card__text__container" }, index.h("div", { key: 'e8d3bdae305eebfaea6b0edb02d77915ececfe14', class: "pn-charts-card__heading__wrapper pn-charts-card__heading__wrapper--horizontal" }, index.h("h2", { key: '9f4eb401ec9c4f5c79433a46556454234fc33e62', class: "pn-charts-card__heading pn-charts-card__heading" }, this.header), index.h("div", { key: '497f231562a12bfded6825ff5a9663c88a5ad547', class: "pn-charts-card__heading__highlight" }, this.highlight)), index.h("span", { key: 'fb7db891bb1b5a49341232ddaac450f2c61040b5', class: "pn-charts-card__preamble" }, this.preamble), index.h("div", { key: 'cc2f2629ebd6703174e1ced56bb9bbd0e3fb4545', class: "pn-charts-card__text__wrapper" }, index.h("div", { key: '7a91367119559d8645c24233c42af3a165002b40', class: "pn-charts-card__source" }, index.h("label", { key: '2d838a336b48b5cf1a697a347952438402dd0d6f' }, this.label), index.h("h3", { key: 'b037cc3a8b7c5d8055ad7c6099d020ccf77c6c84', class: "pn-chart-card__text__heading" }, this.source), this.showCtaLinkText())))))));
32
32
  }
33
33
  };
34
34
  PnChartsCard.style = PnChartsCardStyle0;
@@ -1 +1 @@
1
- {"file":"pn-charts-card.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,eAAe,GAAG,s+JAAs+J,CAAC;AAC//J,2BAAe,eAAe;;MCMjB,YAAY;;;;;;;;;;+BAUY,KAAK;;;IAExC,eAAe,GAAG;QAChB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,QACEA,eAAG,KAAK,EAAC,gBAAgB,EAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,eAAe,GAAG,gCAAgC,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,eAAe,GAAG,QAAQ,GAAG,IAAI,IAChK,IAAI,CAAC,WAAW,OAAEA,qBAAS,IAAI,EAAEC,uBAAW,QAAa,CACxD,EACJ;SACH;QACD,OAAO,IAAI,CAAC;KACb,CAAC;IAEF,MAAM;QACJ,QACED,QAACE,UAAI,uDACHF,mEAAM,IAAI,EAAC,yBAAyB,GAAG,EACvCA,kEAAK,KAAK,EAAC,yBAAyB,IAClCA,kEAAK,KAAK,EAAC,6EAA6E,IACtFA,kEAAK,KAAK,EAAC,yBAAyB,IAAE,IAAI,CAAC,MAAM,CAAO,EACxDA,kEAAK,KAAK,EAAC,oCAAoC,IAAE,IAAI,CAAC,SAAS,CAAO,CAClE,EAENA,kEAAK,KAAK,EAAC,kCAAkC,IAC3CA,mEAAM,IAAI,EAAC,OAAO,GAAQ,EAC1BA,kEAAK,KAAK,EAAC,iCAAiC,IAC1CA,kEAAK,KAAK,EAAC,+EAA+E,IACxFA,kEAAK,KAAK,EAAC,iDAAiD,IAAE,IAAI,CAAC,MAAM,CAAO,EAChFA,kEAAK,KAAK,EAAC,oCAAoC,IAAE,IAAI,CAAC,SAAS,CAAO,CAClE,EACNA,mEAAM,KAAK,EAAC,0BAA0B,IAAE,IAAI,CAAC,QAAQ,CAAQ,EAC7DA,kEAAK,KAAK,EAAC,+BAA+B,IACxCA,kEAAK,KAAK,EAAC,wBAAwB,IACjCA,sEAAQ,IAAI,CAAC,KAAK,CAAS,EAC3BA,iEAAI,KAAK,EAAC,8BAA8B,IAAE,IAAI,CAAC,MAAM,CAAM,EAC1D,IAAI,CAAC,eAAe,EAAE,CACnB,CACF,CACF,CACF,CACF,CACD,EACP;KACH;;;;;;","names":["h","arrow_right","Host"],"sources":["src/components/charts/pn-charts-card/pn-charts-card.scss?tag=pn-charts-card","src/components/charts/pn-charts-card/pn-charts-card.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-charts-card {\n width: 100%;\n height: 100%;\n display: flex;\n\n .pn-charts-card__wrapper {\n width: 100%;\n display: flex;\n flex-direction: column;\n\n border-radius: 2.4rem;\n padding: 2.4rem;\n\n @media screen and (min-width: 1200px) {\n padding: 3.2rem;\n }\n }\n\n .pn-charts-card__heading__wrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: 0.8rem;\n }\n\n .pn-charts-card__heading {\n font-weight: 700;\n font-size: 2.4rem;\n line-height: 110%;\n\n @media screen and (min-width: 1640px) {\n font-size: 3.2rem;\n }\n }\n\n .pn-charts-card__heading__highlight {\n font-weight: 700;\n font-size: 2.4rem;\n line-height: 110%;\n color: $blue700;\n\n @media screen and (min-width: 1640px) {\n font-size: 3.2rem;\n }\n }\n\n .pn-charts-card__content__wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .pn-charts-card__text__container {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n height: 100%;\n }\n\n .pn-charts-card__heading__wrapper--horizontal {\n display: none;\n }\n\n .pn-charts-card__text__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n span {\n display: block;\n margin-bottom: 5.4rem;\n }\n }\n\n .pn-charts-card__preamble {\n font-weight: 400;\n font-size: 1.6rem;\n line-height: 140%;\n flex-grow: 1;\n margin-bottom: 1.6rem;\n\n @media screen and (min-width: 1640px) {\n font-size: 2rem;\n }\n }\n\n .pn-charts-card__source {\n display: flex;\n flex-direction: column;\n\n label {\n background-color: $blue400;\n color: $white;\n border-radius: 0.4rem;\n font-weight: 400;\n font-size: 1rem;\n line-height: 1;\n text-transform: uppercase;\n padding: 0.4rem;\n margin-bottom: 0.6rem;\n width: fit-content;\n\n @media screen and (min-width: 1640px) {\n font-size: 1.2rem;\n padding: 0.6rem;\n }\n }\n\n .pn-chart-card__text__heading {\n font-weight: 400;\n font-size: 1.6rem;\n line-height: 140%;\n color: $blue700;\n margin-bottom: 0;\n\n @media screen and (min-width: 1640px) {\n font-size: 2rem;\n }\n }\n\n a {\n text-decoration: none;\n color: $blue700;\n &:hover {\n text-decoration: underline;\n }\n\n font-weight: 500;\n font-size: 1.6rem;\n text-decoration: none;\n color: $blue700;\n font-weight: 400;\n\n @media screen and (min-width: 1640px) {\n font-size: 2rem;\n }\n\n pn-icon svg {\n path {\n fill: $blue700;\n }\n }\n\n &[target='_blank']:not(.pn-button):after {\n display: none;\n }\n }\n }\n}\n\n//horizontal layout\n.fullwidth {\n & > pn-charts-card {\n .pn-charts-card__wrapper {\n padding: 2.4rem;\n @media screen and (min-width: 992px) {\n padding: 4rem;\n }\n }\n\n .pn-charts-card__heading__wrapper {\n margin-bottom: 3.2rem;\n @media screen and (min-width: 768px) {\n justify-content: flex-start;\n }\n\n gap: 1.6rem;\n }\n\n .pn-charts-card__heading,\n .pn-charts-card__heading__highlight {\n font-size: 2.4rem;\n @media screen and (min-width: 768px) {\n font-size: 3.2rem;\n }\n }\n\n .pn-charts-card__content__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n @media screen and (min-width: 992px) {\n flex-direction: row-reverse;\n gap: 5.6rem;\n }\n\n @media screen and (min-width: 1200px) {\n gap: 4rem;\n }\n\n @media screen and (min-width: 1640px) {\n gap: 3.2rem;\n }\n }\n\n .pn-charts-card__text__container {\n justify-content: center;\n @media screen and (min-width: 768px) {\n width: 100%;\n }\n }\n\n .pn-charts-card__heading__wrapper--vertical {\n display: flex;\n\n @media screen and (min-width: 992px) {\n display: none;\n }\n }\n\n .pn-charts-card__heading__wrapper--horizontal {\n display: none;\n @media screen and (min-width: 992px) {\n display: flex;\n }\n }\n\n .pn-charts-card__preamble {\n @media screen and (min-width: 768px) {\n flex-grow: 0;\n font-size: 2rem;\n }\n }\n }\n}\n\n//colors\npn-charts-card[data-chart-color='blue'] {\n & > .pn-charts-card__wrapper {\n background-color: $blue25;\n }\n}\n\npn-charts-card[data-chart-color='coral'] {\n & > .pn-charts-card__wrapper {\n background-color: $coral50;\n }\n}\n\npn-charts-card[data-chart-color='green'] {\n & > .pn-charts-card__wrapper {\n background-color: $green50;\n }\n}\n\npn-charts-card[data-chart-color='white'] {\n & > .pn-charts-card__wrapper {\n background-color: $white;\n }\n}\n\npn-charts-card[data-chart-color='gray'] {\n & > .pn-charts-card__wrapper {\n background-color: $gray25;\n }\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-charts-card',\n styleUrl: 'pn-charts-card.scss',\n})\nexport class PnChartsCard {\n @Element() hostElement: HTMLElement;\n //props\n @Prop() header: string;\n @Prop() highlight: string;\n @Prop() preamble: string;\n @Prop() label: string;\n @Prop() source: string;\n @Prop() sourceUrl: string;\n @Prop() ctaLinkText: string;\n @Prop() openInNewWindow: boolean = false;\n\n showCtaLinkText = () => {\n if (this.ctaLinkText) {\n return (\n <a class=\"link--animated\" href={this.sourceUrl} rel={this.openInNewWindow ? 'noopener nofollower noreferrer' : null} target={this.openInNewWindow ? '_blank' : null}>\n {this.ctaLinkText} <pn-icon icon={arrow_right}> </pn-icon>\n </a>\n );\n }\n return null;\n };\n\n render() {\n return (\n <Host>\n <slot name=\"clickable-block-wrapper\" />\n <div class=\"pn-charts-card__wrapper\">\n <div class=\"pn-charts-card__heading__wrapper pn-charts-card__heading__wrapper--vertical\">\n <div class=\"pn-charts-card__heading\">{this.header}</div>\n <div class=\"pn-charts-card__heading__highlight\">{this.highlight}</div>\n </div>\n\n <div class=\"pn-charts-card__content__wrapper\">\n <slot name=\"chart\"></slot>\n <div class=\"pn-charts-card__text__container\">\n <div class=\"pn-charts-card__heading__wrapper pn-charts-card__heading__wrapper--horizontal\">\n <div class=\"pn-charts-card__heading pn-charts-card__heading\">{this.header}</div>\n <div class=\"pn-charts-card__heading__highlight\">{this.highlight}</div>\n </div>\n <span class=\"pn-charts-card__preamble\">{this.preamble}</span>\n <div class=\"pn-charts-card__text__wrapper\">\n <div class=\"pn-charts-card__source\">\n <label>{this.label}</label>\n <h3 class=\"pn-chart-card__text__heading\">{this.source}</h3>\n {this.showC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KAAK,EAAC,+BAA+B,IACxCA,kEAAK,KAAK,EAAC,wBAAwB,IACjCA,sEAAQ,IAAI,CAAC,KAAK,CAAS,EAC3BA,iEAAI,KAAK,EAAC,8BAA8B,IAAE,IAAI,CAAC,MAAM,CAAM,EAC1D,IAAI,CAAC,eAAe,EAAE,CACnB,CACF,CACF,CACF,CACF,CACD,EACP;KACH;;;;;;","names":["h","arrow_right","Host"],"sources":["src/components/charts/pn-charts-card/pn-charts-card.scss?tag=pn-charts-card","src/components/charts/pn-charts-card/pn-charts-card.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-charts-card {\n width: 100%;\n height: 100%;\n display: flex;\n\n .pn-charts-card__wrapper {\n width: 100%;\n display: flex;\n flex-direction: column;\n\n border-radius: 2.4rem;\n padding: 2.4rem;\n\n @media screen and (min-width: 1200px) {\n padding: 3.2rem;\n }\n }\n\n .pn-charts-card__heading__wrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: 0.8rem;\n }\n\n .pn-charts-card__heading {\n font-weight: 700;\n font-size: 2.4rem;\n line-height: 110%;\n\n @media screen and (min-width: 1640px) {\n font-size: 3.2rem;\n }\n }\n\n .pn-charts-card__heading__highlight {\n font-weight: 700;\n font-size: 2.4rem;\n line-height: 110%;\n color: $blue700;\n\n @media screen and (min-width: 1640px) {\n font-size: 3.2rem;\n }\n }\n\n .pn-charts-card__content__wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .pn-charts-card__text__container {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n height: 100%;\n }\n\n .pn-charts-card__heading__wrapper--horizontal {\n display: none;\n }\n\n .pn-charts-card__text__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n span {\n display: block;\n margin-bottom: 5.4rem;\n }\n }\n\n .pn-charts-card__preamble {\n font-weight: 400;\n font-size: 1.6rem;\n line-height: 140%;\n flex-grow: 1;\n margin-bottom: 1.6rem;\n\n @media screen and (min-width: 1640px) {\n font-size: 2rem;\n }\n }\n\n .pn-charts-card__source {\n display: flex;\n flex-direction: column;\n\n label {\n background-color: $blue400;\n color: $white;\n border-radius: 0.4rem;\n font-weight: 400;\n font-size: 1rem;\n line-height: 1;\n text-transform: uppercase;\n padding: 0.4rem;\n margin-bottom: 0.6rem;\n width: fit-content;\n\n @media screen and (min-width: 1640px) {\n font-size: 1.2rem;\n padding: 0.6rem;\n }\n }\n\n .pn-chart-card__text__heading {\n font-weight: 400;\n font-size: 1.6rem;\n line-height: 140%;\n color: $blue700;\n margin-bottom: 0;\n\n @media screen and (min-width: 1640px) {\n font-size: 2rem;\n }\n }\n\n a {\n text-decoration: none;\n color: $blue700;\n &:hover {\n text-decoration: underline;\n }\n\n font-weight: 500;\n font-size: 1.6rem;\n text-decoration: none;\n color: $blue700;\n font-weight: 400;\n\n @media screen and (min-width: 1640px) {\n font-size: 2rem;\n }\n\n pn-icon svg {\n path {\n fill: $blue700;\n }\n }\n\n &[target='_blank']:not(.pn-button):after {\n display: none;\n }\n }\n }\n}\n\n//horizontal layout\n.fullwidth {\n & > pn-charts-card {\n .pn-charts-card__wrapper {\n padding: 2.4rem;\n @media screen and (min-width: 992px) {\n padding: 4rem;\n }\n }\n\n .pn-charts-card__heading__wrapper {\n margin-bottom: 3.2rem;\n @media screen and (min-width: 768px) {\n justify-content: flex-start;\n }\n\n gap: 1.6rem;\n }\n\n .pn-charts-card__heading,\n .pn-charts-card__heading__highlight {\n font-size: 2.4rem;\n @media screen and (min-width: 768px) {\n font-size: 3.2rem;\n }\n }\n\n .pn-charts-card__content__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n @media screen and (min-width: 992px) {\n flex-direction: row-reverse;\n gap: 5.6rem;\n }\n\n @media screen and (min-width: 1200px) {\n gap: 4rem;\n }\n\n @media screen and (min-width: 1640px) {\n gap: 3.2rem;\n }\n }\n\n .pn-charts-card__text__container {\n justify-content: center;\n @media screen and (min-width: 768px) {\n width: 100%;\n }\n }\n\n .pn-charts-card__heading__wrapper--vertical {\n display: flex;\n\n @media screen and (min-width: 992px) {\n display: none;\n }\n }\n\n .pn-charts-card__heading__wrapper--horizontal {\n display: none;\n @media screen and (min-width: 992px) {\n display: flex;\n }\n }\n\n .pn-charts-card__preamble {\n @media screen and (min-width: 768px) {\n flex-grow: 0;\n font-size: 2rem;\n }\n }\n }\n}\n\n//colors\npn-charts-card[data-chart-color='blue'] {\n & > .pn-charts-card__wrapper {\n background-color: $blue25;\n }\n}\n\npn-charts-card[data-chart-color='coral'] {\n & > .pn-charts-card__wrapper {\n background-color: $coral50;\n }\n}\n\npn-charts-card[data-chart-color='green'] {\n & > .pn-charts-card__wrapper {\n background-color: $green50;\n }\n}\n\npn-charts-card[data-chart-color='white'] {\n & > .pn-charts-card__wrapper {\n background-color: $white;\n }\n}\n\npn-charts-card[data-chart-color='gray'] {\n & > .pn-charts-card__wrapper {\n background-color: $gray25;\n }\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-charts-card',\n styleUrl: 'pn-charts-card.scss',\n})\nexport class PnChartsCard {\n @Element() hostElement: HTMLElement;\n //props\n @Prop() header: string;\n @Prop() highlight: string;\n @Prop() preamble: string;\n @Prop() label: string;\n @Prop() source: string;\n @Prop() sourceUrl: string;\n @Prop() ctaLinkText: string;\n @Prop() openInNewWindow: boolean = false;\n\n showCtaLinkText = () => {\n if (this.ctaLinkText) {\n return (\n <a class=\"link--animated\" href={this.sourceUrl} rel={this.openInNewWindow ? 'noopener nofollower noreferrer' : null} target={this.openInNewWindow ? '_blank' : null}>\n {this.ctaLinkText} <pn-icon icon={arrow_right}> </pn-icon>\n </a>\n );\n }\n return null;\n };\n\n render() {\n return (\n <Host>\n <slot name=\"clickable-block-wrapper\" />\n <div class=\"pn-charts-card__wrapper\">\n <div class=\"pn-charts-card__heading__wrapper pn-charts-card__heading__wrapper--vertical\">\n <h2 class=\"pn-charts-card__heading\">{this.header}</h2>\n <div class=\"pn-charts-card__heading__highlight\">{this.highlight}</div>\n </div>\n\n <div class=\"pn-charts-card__content__wrapper\">\n <slot name=\"chart\"></slot>\n <div class=\"pn-charts-card__text__container\">\n <div class=\"pn-charts-card__heading__wrapper pn-charts-card__heading__wrapper--horizontal\">\n <h2 class=\"pn-charts-card__heading pn-charts-card__heading\">{this.header}</h2>\n <div class=\"pn-charts-card__heading__highlight\">{this.highlight}</div>\n </div>\n <span class=\"pn-charts-card__preamble\">{this.preamble}</span>\n <div class=\"pn-charts-card__text__wrapper\">\n <div class=\"pn-charts-card__source\">\n <label>{this.label}</label>\n <h3 class=\"pn-chart-card__text__heading\">{this.source}</h3>\n {this.showCtaLinkText()}\n </div>\n </div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -91,22 +91,29 @@ const PnDateAndTime = class {
91
91
  handleChange(e) {
92
92
  const target = e.target;
93
93
  if (target === this.pnDatePicker) {
94
- this.selectedDate = e.detail;
94
+ this.selectedDate = e.detail.start;
95
95
  }
96
- if (target === this.pnTimeFromHourDropdown || target === this.pnTimeFromMinuteDropdown || target === this.pnTimeToHourDropdown || target === this.pnTimeToMinuteDropdown) {
97
- this.handleTimeChange();
98
- }
99
- this.updateHiddenValue();
100
- }
101
- handleTimeChange() {
102
- const fromHourString = this.pnTimeFromHourDropdown.querySelector('[aria-selected=true]')?.textContent;
103
- const fromMinString = this.pnTimeFromMinuteDropdown.querySelector('[aria-selected=true]')?.textContent;
104
- const toHourString = this.pnTimeToHourDropdown.querySelector('[aria-selected=true]')?.textContent;
105
- const toMinString = this.pnTimeToMinuteDropdown.querySelector('[aria-selected=true]')?.textContent;
96
+ const fromHourString = this.pnTimeFromHourDropdown.outerText;
97
+ const fromMinString = this.pnTimeFromMinuteDropdown.outerText;
98
+ const toHourString = this.pnTimeToHourDropdown.outerText;
99
+ const toMinString = this.pnTimeToMinuteDropdown.outerText;
106
100
  this.selectedFromHour = parseInt(fromHourString);
107
101
  this.selectedFromMin = parseInt(fromMinString);
108
102
  this.selectedToHour = parseInt(toHourString);
109
103
  this.selectedToMin = parseInt(toMinString);
104
+ if (target === this.pnTimeFromHourDropdown) {
105
+ this.selectedFromHour = parseInt(e.detail.value);
106
+ }
107
+ if (target === this.pnTimeFromMinuteDropdown) {
108
+ this.selectedFromMin = parseInt(e.detail.value);
109
+ }
110
+ if (target === this.pnTimeToHourDropdown) {
111
+ this.selectedToHour = parseInt(e.detail.value);
112
+ }
113
+ if (target === this.pnTimeToMinuteDropdown) {
114
+ this.selectedToMin = parseInt(e.detail.value);
115
+ }
116
+ this.updateHiddenValue();
110
117
  }
111
118
  updateHiddenValue() {
112
119
  const date = new Date();
@@ -144,7 +151,7 @@ const PnDateAndTime = class {
144
151
  });
145
152
  }
146
153
  render() {
147
- return (index.h(index.Host, { key: '6f7c0f1c403a98ceaadef017f6dfe94e4d09ab06' }, index.h("div", { key: 'c4f95d2e042277cd090fa8a8ce4dd6cd357943ad', class: "date-and-time-group" }, this.dateAndTimeLabel ? (index.h("div", { class: "date-and-time-row" }, index.h("label", null, this.dateAndTimeLabel))) : null, index.h("div", { key: '2c772ab7b24783c634a06879cfede0eaf05952d6', class: "date-and-time-row" }, index.h("pn-date-picker", { key: '6a427ea028bf55b067b0885e2d3b97a0349acdd3', ref: el => (this.pnDatePicker = el), range: "false", "disable-weekends": this.disableWeekends, "min-date": this.firstValidDateString, "max-date": this.lastValidDateString, language: this.language, placeholder: this.datePlacehodler })), this.dateHelperText ? index.h("small", { class: "date-and-time-row helper-text" }, this.dateHelperText) : null), index.h("div", { key: '7f74f041493bb4da72d070e90d24d38441c5ebb9', class: "date-and-time-group" }, index.h("div", { key: '7b7b4b4ba67f36cf03c4ee6b80a3cdd55a5c8380', class: "date-and-time-row" }, index.h("pn-select", { key: 'd5d6fe2b881a8770fc1aec24bce38754b6a17db0', ref: el => (this.pnTimeFromHourDropdown = el), name: "date-and-time-from-houre", placeholder: this.hourArr[8], class: "date-and-time-dropdown--time", invalid: this.invalidTimespan }, this.hourArr?.map((hour) => index.h("pn-option", { label: hour, value: hour }))), index.h("pn-select", { key: 'bb8dafe866a95e94e0e8a1e53ccff80d0729ec48', ref: el => (this.pnTimeFromMinuteDropdown = el), name: "date-and-time-from-minute", placeholder: this.minuteArr[0], class: "date-and-time-dropdown--time", invalid: this.invalidTimespan }, this.minuteArr?.map((minute) => index.h("pn-option", { label: minute, value: minute }))), index.h("div", { key: '8281bbfae49ca8ec35a1d651d61a1bd478b70c0a', class: "time-separator" }, index.h("span", { key: 'd7c895902ce3efac4816f21510444914012fca29' }, "-")), index.h("pn-select", { key: '5fa29d4fc4d01a804427bd2119969ec0d6346df6', ref: el => (this.pnTimeToHourDropdown = el), name: "date-and-time-to-hour", placeholder: this.hourArr[12], class: "date-and-time-dropdown--time", invalid: this.invalidTimespan }, this.hourArr?.map((hour) => index.h("pn-option", { label: hour, value: hour }))), index.h("pn-select", { key: '968f33b37cad6d2528a789abd63a89c163642c53', ref: el => (this.pnTimeToMinuteDropdown = el), name: "date-and-time-to-minute", placeholder: this.minuteArr[0], class: "date-and-time-dropdown--time", invalid: this.invalidTimespan }, this.minuteArr?.map((minute) => index.h("pn-option", { label: minute, value: minute })))), this.timeHelperText ? index.h("small", { class: "date-and-time-row helper-text" }, this.timeHelperText) : null, this.invalidTimespan && this.errorMessage ? (index.h("small", { class: "date-and-time-row error-message" }, index.h("pn-icon", { icon: alert_info_circle, small: "false", color: "warning" }), this.errorMessage)) : null)));
154
+ return (index.h(index.Host, { key: '427046301b2ac39e7eec2606f03a219a052331c5' }, index.h("div", { key: '229f301ac20c70eea858802f46ba86c408e2079b', class: "date-and-time-group" }, this.dateAndTimeLabel ? (index.h("div", { class: "date-and-time-row" }, index.h("label", null, this.dateAndTimeLabel))) : null, index.h("div", { key: 'e861465a653b789df0058a16153e7b8f894c03de', class: "date-and-time-row" }, index.h("pn-date-picker", { key: '62ddce7306500633d72cdc4d12db989ac3c02b70', ref: el => (this.pnDatePicker = el), range: "false", "disable-weekends": this.disableWeekends, "min-date": this.firstValidDateString, "max-date": this.lastValidDateString, language: this.language, placeholder: this.datePlacehodler })), this.dateHelperText ? index.h("small", { class: "date-and-time-row helper-text" }, this.dateHelperText) : null), index.h("div", { key: '238e07b7c5c3e32a57fd4f63f5f0605d8f53020d', class: "date-and-time-group" }, index.h("div", { key: '31157ce2f842378db771141eb003f5c19d6adaed', class: "date-and-time-row" }, index.h("pn-select", { key: 'eb874ddc6dea2d1c62d557712576047c38a9f077', ref: el => (this.pnTimeFromHourDropdown = el), name: "date-and-time-from-houre", placeholder: this.hourArr[8], class: "date-and-time-dropdown--time", invalid: this.invalidTimespan }, this.hourArr?.map((hour) => index.h("pn-option", { label: hour, value: hour }))), index.h("pn-select", { key: 'c7721bed19e520e881780b456fa5fe6a20abd2eb', ref: el => (this.pnTimeFromMinuteDropdown = el), name: "date-and-time-from-minute", placeholder: this.minuteArr[0], class: "date-and-time-dropdown--time", invalid: this.invalidTimespan }, this.minuteArr?.map((minute) => index.h("pn-option", { label: minute, value: minute }))), index.h("div", { key: '6f6532649c8a6eee91b96f5152c0086d77a0c543', class: "time-separator" }, index.h("span", { key: '3e43b12bc5e6f4ed1d8d6330760ced467e39ef5c' }, "-")), index.h("pn-select", { key: 'ebe92ab375e3a9777b6b77b9dd45976cf26c6d9f', ref: el => (this.pnTimeToHourDropdown = el), name: "date-and-time-to-hour", placeholder: this.hourArr[12], class: "date-and-time-dropdown--time", invalid: this.invalidTimespan }, this.hourArr?.map((hour) => index.h("pn-option", { label: hour, value: hour }))), index.h("pn-select", { key: '38c2b11d4f8c0fd5206ffdb6a3bb8194a0ce495d', ref: el => (this.pnTimeToMinuteDropdown = el), name: "date-and-time-to-minute", placeholder: this.minuteArr[0], class: "date-and-time-dropdown--time", invalid: this.invalidTimespan }, this.minuteArr?.map((minute) => index.h("pn-option", { label: minute, value: minute })))), this.timeHelperText ? index.h("small", { class: "date-and-time-row helper-text" }, this.timeHelperText) : null, this.invalidTimespan && this.errorMessage ? (index.h("small", { class: "date-and-time-row error-message" }, index.h("pn-icon", { icon: alert_info_circle, small: "false", color: "warning" }), this.errorMessage)) : null)));
148
155
  }
149
156
  };
150
157
  PnDateAndTime.style = PnDateAndTimeStyle0;
@@ -1 +1 @@
1
- {"file":"pn-date-and-time.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,IAAI,GAAG,4VAA4V,CAAC;AACnW,MAAM,iBAAiB,GAAG,IAAI;;ACDrC,MAAM,gBAAgB,GAAG,wbAAwb,CAAC;AACld,4BAAe,gBAAgB;;MCMlB,aAAa;;;;4BAQO,IAAI;gCACA,EAAE;iCACD,CAAC;qCACG,CAAC;4BACV,EAAE;8BACA,EAAE;8BACF,EAAE;+BACA,KAAK;+BACN,EAAE;wBAER,IAAI;uBACH,IAAI;yBACF,IAAI;yBACN,IAAI;+BACG,KAAK;4BACT,IAAI;gCACA,IAAI;+BACL,IAAI;8BACL,IAAI;6BACL,IAAI;oCACG,EAAE;mCACH,EAAE;;;IA3BzC,YAAY,GAAgB,IAAI,CAAC;IACjC,sBAAsB,GAAgB,IAAI,CAAC;IAC3C,wBAAwB,GAAgB,IAAI,CAAC;IAC7C,oBAAoB,GAAgB,IAAI,CAAC;IACzC,sBAAsB,GAAgB,IAAI,CAAC;IAyBlC,gBAAgB,CAAuB;IAEhD,iBAAiB;QACf,IAAI,CAAC,gBAAgB,EAAE,CAAC;KACzB;IAED,gBAAgB;QACd,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,gBAAgB,EAAE,CAAC;KACzB;IAED,MAAM,gBAAgB;QACpB,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAEzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,qBAAqB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,qBAAqB,CAAC,CA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A+B,IAAE,IAAI,CAAC,cAAc,CAAS,GAAG,IAAI,EAEvG,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,YAAY,IACxCA,mBAAO,KAAK,EAAC,iCAAiC,IAC5CA,qBAAS,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,GAAG,EACjE,IAAI,CAAC,YAAY,CACZ,IACN,IAAI,CACJ,CACD,EACP;KACH;;;;;;","names":["h","Host"],"sources":["node_modules/pn-design-assets/pn-assets/icons/alert_info_circle.js","src/components/input/pn-date-and-time/pn-date-and-time.scss?tag=pn-date-and-time","src/components/input/pn-date-and-time/pn-date-and-time.tsx"],"sourcesContent":["const icon = '<svg class=\"pn-icon-svg\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"#000\" fill-rule=\"evenodd\" d=\"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0m8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m0 8a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m1 2v4.5a1 1 0 1 1-2 0V12a1 1 0 1 1 2 0\" clip-rule=\"evenodd\"/></svg>';\nexport const alert_info_circle = icon;\nexport const alertInfoCircle = icon;\n","@import '../../../globals/main.scss';\n\npn-date-and-time {\n label {\n color: $gray700;\n font-size: 1.4rem;\n }\n\n .time-separator {\n margin-top: auto;\n margin-bottom: auto;\n }\n\n .date-and-time-group {\n margin-bottom: 1rem;\n }\n .date-and-time-row {\n display: flex;\n gap: 1rem;\n }\n\n .helper-text {\n margin-top: 0.2rem;\n color: $gray700;\n display: block;\n }\n\n .error-message {\n color: #a70707;\n }\n}\n","import { Component, Prop, h, Element, State, Host, Event, EventEmitter } from '@stencil/core';\nimport { alert_info_circle } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-date-and-time',\n styleUrl: 'pn-date-and-time.scss',\n})\nexport class PnDateAndTime {\n @Element() hostElement: Element;\n pnDatePicker: HTMLElement = null;\n pnTimeFromHourDropdown: HTMLElement = null;\n pnTimeFromMinuteDropdown: HTMLElement = null;\n pnTimeToHourDropdown: HTMLElement = null;\n pnTimeToMinuteDropdown: HTMLElement = null;\n\n @Prop() languageCode: string = null;\n @Prop() dateAndTimeLabel: string = '';\n @Prop() dateDaysFromToday: number = 0;\n @Prop() validTimeRangeMinutes: number = 0;\n @Prop() errorMessage: string = '';\n @Prop() dateHelperText: string = '';\n @Prop() timeHelperText: string = '';\n @Prop() disableWeekends: boolean = false;\n @Prop() datePlacehodler: string = '';\n\n @State() language: string = null;\n @State() hourArr: string[] = null;\n @State() minuteArr: string[] = null;\n @State() formValue: string = null;\n @State() invalidTimespan: boolean = false;\n @State() selectedDate: string = null;\n @State() selectedFromHour: number = null;\n @State() selectedFromMin: number = null;\n @State() selectedToHour: number = null;\n @State() selectedToMin: number = null;\n @State() firstValidDateString: string = '';\n @State() lastValidDateString: string = '';\n\n @Event() dateandtimerange: EventEmitter<string>;\n\n componentWillLoad() {\n this.setInitialValues();\n }\n\n componentDidLoad() {\n this.setDefaultHiddenValue();\n this.addEventHandlers();\n }\n\n async setInitialValues() {\n this.setLangugaeCode();\n this.setFirstValidDate();\n\n this.hourArr = this.getNumbersAsStringArr(6, 22, 1);\n this.minuteArr = this.getNumbersAsStringArr(0, 50, 10);\n }\n\n setFirstValidDate() {\n const date = new Date();\n date.setDate(date.getDate() + this.dateDaysFromToday ?? 0);\n\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n const endYear = year + 2;\n\n this.firstValidDateString = `${year.toString()}-${month}-${day}`;\n this.lastValidDateString = `${endYear.toString()}-${month}-${day}`;\n }\n\n setLangugaeCode() {\n if (typeof this.languageCode === 'string' && this.languageCode.trim() === '') {\n this.language = document.querySelector('html').lang;\n } else {\n this.language = this.languageCode;\n }\n }\n\n setDefaultHiddenValue() {\n this.selectedFromHour = parseInt(this.hourArr[8]);\n this.selectedFromMin = 0;\n this.selectedToHour = parseInt(this.hourArr[12]);\n this.selectedToMin = 0;\n\n this.updateHiddenValue();\n }\n\n addEventHandlers() {\n this.pnDatePicker.addEventListener('dateselection', this.handleChange.bind(this));\n\n this.pnTimeFromHourDropdown.addEventListener('selectOption', this.handleChange.bind(this));\n this.pnTimeFromMinuteDropdown.addEventListener('selectOption', this.handleChange.bind(this));\n this.pnTimeToHourDropdown.addEventListener('selectOption', this.handleChange.bind(this));\n this.pnTimeToMinuteDropdown.addEventListener('selectOption', this.handleChange.bind(this));\n }\n\n handleChange(e) {\n const target = e.target;\n\n if (target === this.pnDatePicker) {\n this.selectedDate = e.detail;\n }\n\n if (target === this.pnTimeFromHourDropdown || target === this.pnTimeFromMinuteDropdown || target === this.pnTimeToHourDropdown || target === this.pnTimeToMinuteDropdown) {\n this.handleTimeChange();\n }\n\n this.updateHiddenValue();\n }\n\n handleTimeChange() {\n const fromHourString = this.pnTimeFromHourDropdown.querySelector('[aria-selected=true]')?.textContent;\n const fromMinString = this.pnTimeFromMinuteDropdown.querySelector('[aria-selected=true]')?.textContent;\n const toHourString = this.pnTimeToHourDropdown.querySelector('[aria-selected=true]')?.textContent;\n const toMinString = this.pnTimeToMinuteDropdown.querySelector('[aria-selected=true]')?.textContent;\n\n this.selectedFromHour = parseInt(fromHourString);\n this.selectedFromMin = parseInt(fromMinString);\n this.selectedToHour = parseInt(toHourString);\n this.selectedToMin = parseInt(toMinString);\n }\n\n updateHiddenValue() {\n const date = new Date();\n const dateFrom = new Date(date.getFullYear(), date.getMonth(), date.getDate(), this.selectedFromHour, this.selectedFromMin, 0, 0);\n const dateTo = new Date(date.getFullYear(), date.getMonth(), date.getDate(), this.selectedToHour, this.selectedToMin, 0, 0);\n this.validateTimeRange(dateFrom.getTime(), dateTo.getTime());\n\n if (this.invalidTimespan || !this.selectedDate) {\n this.formValue = '';\n } else {\n const fromMin = this.selectedFromMin.toString().padStart(2, '0');\n const toMin = this.selectedToMin.toString().padStart(2, '0');\n\n this.formValue = `${this.selectedDate}, ${this.selectedFromHour}:${fromMin}-${this.selectedToHour}:${toMin}`;\n }\n\n this.dateandtimerange.emit(this.formValue);\n }\n\n validateTimeRange(from: number, to: number) {\n let differenceValue = (to - from) / 1000;\n differenceValue /= 60;\n this.invalidTimespan = differenceValue < this.validTimeRangeMinutes ? true : false;\n }\n\n getNumbersAsStringArr(start: number, stop: number, step: number) {\n const arr = Array.from({ length: (stop - start) / step + 1 }, (_, index: number) => start + index * step);\n const result: string[] = [];\n\n arr.forEach(item => {\n const itemAsString = item.toString().padStart(2, '0');\n result.push(itemAsString);\n });\n\n return result;\n }\n\n removePnOptionSelected() {\n const selectOptions = this.hostElement.querySelectorAll('pn-option');\n selectOptions.forEach(elm => {\n elm.removeAttribute('selected');\n });\n }\n\n render() {\n return (\n <Host>\n <div class=\"date-and-time-group\">\n {this.dateAndTimeLabel ? (\n <div class=\"date-and-time-row\">\n <label>{this.dateAndTimeLabel}</label>\n </div>\n ) : null}\n <div class=\"date-and-time-row\">\n <pn-date-picker\n ref={el => (this.pnDatePicker = el as HTMLElement)}\n range=\"false\"\n disable-weekends={this.disableWeekends}\n min-date={this.firstValidDateString}\n max-date={this.lastValidDateString}\n language={this.language}\n placeholder={this.datePlacehodler}\n ></pn-date-picker>\n </div>\n\n {this.dateHelperText ? <small class=\"date-and-time-row helper-text\">{this.dateHelperText}</small> : null}\n </div>\n <div class=\"date-and-time-group\">\n <div class=\"date-and-time-row\">\n <pn-select\n ref={el => (this.pnTimeFromHourDropdown = el as HTMLElement)}\n name=\"date-and-time-from-houre\"\n placeholder={this.hourArr[8]}\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan}\n >\n {this.hourArr?.map((hour: string) => <pn-option label={hour} value={hour}></pn-option>)}\n </pn-select>\n <pn-select\n ref={el => (this.pnTimeFromMinuteDropdown = el as HTMLElement)}\n name=\"date-and-time-from-minute\"\n placeholder={this.minuteArr[0]}\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan}\n >\n {this.minuteArr?.map((minute: string) => <pn-option label={minute} value={minute}></pn-option>)}\n </pn-select>\n <div class=\"time-separator\">\n <span>-</span>\n </div>\n <pn-select\n ref={el => (this.pnTimeToHourDropdown = el as HTMLElement)}\n name=\"date-and-time-to-hour\"\n placeholder={this.hourArr[12]}\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan}\n >\n {this.hourArr?.map((hour: string) => <pn-option label={hour} value={hour}></pn-option>)}\n </pn-select>\n <pn-select\n ref={el => (this.pnTimeToMinuteDropdown = el as HTMLElement)}\n name=\"date-and-time-to-minute\"\n placeholder={this.minuteArr[0]}\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan}\n >\n {this.minuteArr?.map((minute: string) => <pn-option label={minute} value={minute}></pn-option>)}\n </pn-select>\n </div>\n {this.timeHelperText ? <small class=\"date-and-time-row helper-text\">{this.timeHelperText}</small> : null}\n\n {this.invalidTimespan && this.errorMessage ? (\n <small class=\"date-and-time-row error-message\">\n <pn-icon icon={alert_info_circle} small=\"false\" color=\"warning\" />\n {this.errorMessage}\n </small>\n ) : null}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pn-date-and-time.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,IAAI,GAAG,4VAA4V,CAAC;AACnW,MAAM,iBAAiB,GAAG,IAAI;;ACDrC,MAAM,gBAAgB,GAAG,wbAAwb,CAAC;AACld,4BAAe,gBAAgB;;MCMlB,aAAa;;;;4BAQO,IAAI;gCACA,EAAE;iCACD,CAAC;qCACG,CAAC;4BACV,EAAE;8BACA,EAAE;8BACF,EAAE;+BACA,KAAK;+BACN,EAAE;wBAER,IAAI;uBACH,IAAI;yBACF,IAAI;yBACN,IAAI;+BACG,KAAK;4BACT,IAAI;gCACA,IAAI;+BACL,IAAI;8BACL,IAAI;6BACL,IAAI;oCACG,EAAE;mCACH,EAAE;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c,CAAC,CACrF,EACZA,kEAAK,KAAK,EAAC,gBAAgB,IACzBA,yEAAc,CACV,EACNA,wEACE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,oBAAoB,GAAG,EAAiB,CAAC,EAC1D,IAAI,EAAC,uBAAuB,EAC5B,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAC7B,KAAK,EAAC,8BAA8B,EACpC,OAAO,EAAE,IAAI,CAAC,eAAe,IAE5B,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAY,KAAKA,uBAAW,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAc,CAAC,CAC7E,EACZA,wEACE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,sBAAsB,GAAG,EAAiB,CAAC,EAC5D,IAAI,EAAC,yBAAyB,EAC9B,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAC,8BAA8B,EACpC,OAAO,EAAE,IAAI,CAAC,eAAe,IAE5B,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,MAAc,KAAKA,uBAAW,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAc,CAAC,CACrF,CACR,EACL,IAAI,CAAC,cAAc,GAAGA,mBAAO,KAAK,EAAC,+BAA+B,IAAE,IAAI,CAAC,cAAc,CAAS,GAAG,IAAI,EAEvG,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,YAAY,IACxCA,mBAAO,KAAK,EAAC,iCAAiC,IAC5CA,qBAAS,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,GAAG,EACjE,IAAI,CAAC,YAAY,CACZ,IACN,IAAI,CACJ,CACD,EACP;KACH;;;;;;","names":["h","Host"],"sources":["node_modules/pn-design-assets/pn-assets/icons/alert_info_circle.js","src/components/input/pn-date-and-time/pn-date-and-time.scss?tag=pn-date-and-time","src/components/input/pn-date-and-time/pn-date-and-time.tsx"],"sourcesContent":["const icon = '<svg class=\"pn-icon-svg\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"#000\" fill-rule=\"evenodd\" d=\"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0m8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m0 8a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m1 2v4.5a1 1 0 1 1-2 0V12a1 1 0 1 1 2 0\" clip-rule=\"evenodd\"/></svg>';\nexport const alert_info_circle = icon;\nexport const alertInfoCircle = icon;\n","@import '../../../globals/main.scss';\n\npn-date-and-time {\n label {\n color: $gray700;\n font-size: 1.4rem;\n }\n\n .time-separator {\n margin-top: auto;\n margin-bottom: auto;\n }\n\n .date-and-time-group {\n margin-bottom: 1rem;\n }\n .date-and-time-row {\n display: flex;\n gap: 1rem;\n }\n\n .helper-text {\n margin-top: 0.2rem;\n color: $gray700;\n display: block;\n }\n\n .error-message {\n color: #a70707;\n }\n}\n","import { Component, Prop, h, Element, State, Host, Event, EventEmitter } from '@stencil/core';\nimport { alert_info_circle } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-date-and-time',\n styleUrl: 'pn-date-and-time.scss',\n})\nexport class PnDateAndTime {\n @Element() hostElement: Element;\n pnDatePicker: HTMLElement = null;\n pnTimeFromHourDropdown: HTMLElement = null;\n pnTimeFromMinuteDropdown: HTMLElement = null;\n pnTimeToHourDropdown: HTMLElement = null;\n pnTimeToMinuteDropdown: HTMLElement = null;\n\n @Prop() languageCode: string = null;\n @Prop() dateAndTimeLabel: string = '';\n @Prop() dateDaysFromToday: number = 0;\n @Prop() validTimeRangeMinutes: number = 0;\n @Prop() errorMessage: string = '';\n @Prop() dateHelperText: string = '';\n @Prop() timeHelperText: string = '';\n @Prop() disableWeekends: boolean = false;\n @Prop() datePlacehodler: string = '';\n\n @State() language: string = null;\n @State() hourArr: string[] = null;\n @State() minuteArr: string[] = null;\n @State() formValue: string = null;\n @State() invalidTimespan: boolean = false;\n @State() selectedDate: string = null;\n @State() selectedFromHour: number = null;\n @State() selectedFromMin: number = null;\n @State() selectedToHour: number = null;\n @State() selectedToMin: number = null;\n @State() firstValidDateString: string = '';\n @State() lastValidDateString: string = '';\n\n @Event() dateandtimerange: EventEmitter<string>;\n\n componentWillLoad() {\n this.setInitialValues();\n }\n\n componentDidLoad() {\n this.setDefaultHiddenValue();\n this.addEventHandlers();\n }\n\n async setInitialValues() {\n this.setLangugaeCode();\n this.setFirstValidDate();\n\n this.hourArr = this.getNumbersAsStringArr(6, 22, 1);\n this.minuteArr = this.getNumbersAsStringArr(0, 50, 10);\n }\n\n setFirstValidDate() {\n const date = new Date();\n date.setDate(date.getDate() + this.dateDaysFromToday ?? 0);\n\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n const endYear = year + 2;\n\n this.firstValidDateString = `${year.toString()}-${month}-${day}`;\n this.lastValidDateString = `${endYear.toString()}-${month}-${day}`;\n }\n\n setLangugaeCode() {\n if (typeof this.languageCode === 'string' && this.languageCode.trim() === '') {\n this.language = document.querySelector('html').lang;\n } else {\n this.language = this.languageCode;\n }\n }\n\n setDefaultHiddenValue() {\n this.selectedFromHour = parseInt(this.hourArr[8]);\n this.selectedFromMin = 0;\n this.selectedToHour = parseInt(this.hourArr[12]);\n this.selectedToMin = 0;\n\n this.updateHiddenValue();\n }\n\n addEventHandlers() {\n this.pnDatePicker.addEventListener('dateselection', this.handleChange.bind(this));\n\n this.pnTimeFromHourDropdown.addEventListener('selectOption', this.handleChange.bind(this));\n this.pnTimeFromMinuteDropdown.addEventListener('selectOption', this.handleChange.bind(this));\n this.pnTimeToHourDropdown.addEventListener('selectOption', this.handleChange.bind(this));\n this.pnTimeToMinuteDropdown.addEventListener('selectOption', this.handleChange.bind(this));\n }\n\n handleChange(e) {\n const target = e.target;\n\n if (target === this.pnDatePicker) {\n this.selectedDate = e.detail.start;\n }\n \n const fromHourString = this.pnTimeFromHourDropdown.outerText;\n const fromMinString = this.pnTimeFromMinuteDropdown.outerText;\n const toHourString = this.pnTimeToHourDropdown.outerText;\n const toMinString = this.pnTimeToMinuteDropdown.outerText;\n\n this.selectedFromHour = parseInt(fromHourString);\n this.selectedFromMin = parseInt(fromMinString);\n this.selectedToHour = parseInt(toHourString);\n this.selectedToMin = parseInt(toMinString);\n\n if (target === this.pnTimeFromHourDropdown) {\n this.selectedFromHour = parseInt(e.detail.value);\n }\n\n if (target === this.pnTimeFromMinuteDropdown) {\n this.selectedFromMin = parseInt(e.detail.value);\n }\n\n if (target === this.pnTimeToHourDropdown) {\n this.selectedToHour = parseInt(e.detail.value);\n }\n\n if (target === this.pnTimeToMinuteDropdown) {\n this.selectedToMin = parseInt(e.detail.value);\n }\n\n this.updateHiddenValue();\n }\n\n updateHiddenValue() {\n const date = new Date();\n const dateFrom = new Date(date.getFullYear(), date.getMonth(), date.getDate(), this.selectedFromHour, this.selectedFromMin, 0, 0);\n const dateTo = new Date(date.getFullYear(), date.getMonth(), date.getDate(), this.selectedToHour, this.selectedToMin, 0, 0);\n this.validateTimeRange(dateFrom.getTime(), dateTo.getTime());\n\n if (this.invalidTimespan || !this.selectedDate) {\n this.formValue = '';\n } else {\n const fromMin = this.selectedFromMin.toString().padStart(2, '0');\n const toMin = this.selectedToMin.toString().padStart(2, '0');\n\n this.formValue = `${this.selectedDate}, ${this.selectedFromHour}:${fromMin}-${this.selectedToHour}:${toMin}`;\n }\n \n this.dateandtimerange.emit(this.formValue);\n }\n\n validateTimeRange(from: number, to: number) {\n let differenceValue = (to - from) / 1000;\n differenceValue /= 60;\n this.invalidTimespan = differenceValue < this.validTimeRangeMinutes ? true : false;\n }\n\n getNumbersAsStringArr(start: number, stop: number, step: number) {\n const arr = Array.from({ length: (stop - start) / step + 1 }, (_, index: number) => start + index * step);\n const result: string[] = [];\n\n arr.forEach(item => {\n const itemAsString = item.toString().padStart(2, '0');\n result.push(itemAsString);\n });\n\n return result;\n }\n\n removePnOptionSelected() {\n const selectOptions = this.hostElement.querySelectorAll('pn-option');\n selectOptions.forEach(elm => {\n elm.removeAttribute('selected');\n });\n }\n\n render() {\n return (\n <Host>\n <div class=\"date-and-time-group\">\n {this.dateAndTimeLabel ? (\n <div class=\"date-and-time-row\">\n <label>{this.dateAndTimeLabel}</label>\n </div>\n ) : null}\n <div class=\"date-and-time-row\">\n <pn-date-picker\n ref={el => (this.pnDatePicker = el as HTMLElement)}\n range=\"false\"\n disable-weekends={this.disableWeekends}\n min-date={this.firstValidDateString}\n max-date={this.lastValidDateString}\n language={this.language}\n placeholder={this.datePlacehodler}\n ></pn-date-picker>\n </div>\n\n {this.dateHelperText ? <small class=\"date-and-time-row helper-text\">{this.dateHelperText}</small> : null}\n </div>\n <div class=\"date-and-time-group\">\n <div class=\"date-and-time-row\">\n <pn-select\n ref={el => (this.pnTimeFromHourDropdown = el as HTMLElement)}\n name=\"date-and-time-from-houre\"\n placeholder={this.hourArr[8]}\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan}\n >\n {this.hourArr?.map((hour: string) => <pn-option label={hour} value={hour}></pn-option>)}\n </pn-select>\n <pn-select\n ref={el => (this.pnTimeFromMinuteDropdown = el as HTMLElement)}\n name=\"date-and-time-from-minute\"\n placeholder={this.minuteArr[0]}\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan}\n >\n {this.minuteArr?.map((minute: string) => <pn-option label={minute} value={minute}></pn-option>)}\n </pn-select>\n <div class=\"time-separator\">\n <span>-</span>\n </div>\n <pn-select\n ref={el => (this.pnTimeToHourDropdown = el as HTMLElement)}\n name=\"date-and-time-to-hour\"\n placeholder={this.hourArr[12]}\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan}\n >\n {this.hourArr?.map((hour: string) => <pn-option label={hour} value={hour}></pn-option>)}\n </pn-select>\n <pn-select\n ref={el => (this.pnTimeToMinuteDropdown = el as HTMLElement)}\n name=\"date-and-time-to-minute\"\n placeholder={this.minuteArr[0]}\n class=\"date-and-time-dropdown--time\"\n invalid={this.invalidTimespan}\n >\n {this.minuteArr?.map((minute: string) => <pn-option label={minute} value={minute}></pn-option>)}\n </pn-select>\n </div>\n {this.timeHelperText ? <small class=\"date-and-time-row helper-text\">{this.timeHelperText}</small> : null}\n\n {this.invalidTimespan && this.errorMessage ? (\n <small class=\"date-and-time-row error-message\">\n <pn-icon icon={alert_info_circle} small=\"false\" color=\"warning\" />\n {this.errorMessage}\n </small>\n ) : null}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -160,7 +160,7 @@ const PnDropdownWithMultiInputRowsRow = class {
160
160
  handleDateChange(e) {
161
161
  const elm = e.target;
162
162
  if (elm === this.pnDatePicker) {
163
- this.dateValue = e.detail;
163
+ this.dateValue = e.detail.start;
164
164
  }
165
165
  }
166
166
  emitRowValues() {
@@ -175,7 +175,7 @@ const PnDropdownWithMultiInputRowsRow = class {
175
175
  this.deleteRowEvent.emit(this._predefinedValue.id);
176
176
  }
177
177
  render() {
178
- return (index.h(index.Host, { key: '101265b9e24ada0da3199690b2c2f56cfd7d6a00' }, index.h("div", { key: 'fed264cfb3a052b3b2b5b26d2484e9787eaa3d36', class: "input-element-row" }, index.h("div", { key: '6161953b428a44b37defc7c3e2d6a95d79845c36', class: "input-container" }, index.h("pn-marketweb-input", { key: '7e155be4887029e727ac78380ab5783ce50301d4', ref: el => (this.pnFirstInputField = el), type: "number", placeholder: this.fristInputPlaceholder, value: this.firstInputValue, min: "1" }), this.showFirstInputLowError || this.showFirstInputHighError || this.showFirstInputWarning ? (index.h("div", { class: "input-element-message-container" }, this.showFirstInputLowError ? (index.h("div", { class: "input-element-message-container__error" }, index.h("small", null, this.firstInputLowErrorText))) : null, this.showFirstInputHighError ? (index.h("div", { class: "input-element-message-container__error" }, index.h("small", null, this.firstInputHighErrorText))) : null, this.showFirstInputWarning ? (index.h("div", { class: "input-element-message-container__warning" }, index.h("small", null, this.firstInputWarningText))) : null)) : null), index.h("div", { key: '1bad690de5ffe9e79c18614bcd3224d9fb5940fe', class: "input-container" }, index.h("pn-marketweb-input", { key: '7894824d20d159e2a03f131d3e348f06e7ce67a4', ref: el => (this.pnSecondInputField = el), type: "number", placeholder: this.secondInputPlaceholder, value: this.secondInputValue, min: "1" }), this.showSecondInputLowError || this.showSecondInputHighError || this.showSecondInputWarning ? (index.h("div", { class: "input-element-message-container" }, this.showSecondInputLowError ? (index.h("div", { class: "input-element-message-container__error" }, index.h("small", null, this.secondInputLowErrorText))) : null, this.showSecondInputHighError ? (index.h("div", { class: "input-element-message-container__error" }, index.h("small", null, this.secondInputHighErrorText))) : null, this.showSecondInputWarning ? (index.h("div", { class: "input-element-message-container__warning" }, index.h("small", null, this.secondInputWarningText))) : null)) : null), index.h("div", { key: '209e5aa157272445cb02f7634d7b503b8be34a48', class: "input-container" }, index.h("pn-date-picker", { key: 'e284c5c8ef3eebed689d9bd3f7ec29c11d51190d', ref: el => (this.pnDatePicker = el), range: "false", "disable-weekends": true, "min-date": this.firstValidDate, "max-date": this.lastValidDate, language: this.languageCode, placeholder: this.datePlaceholder, start: this.dateValue?.length ? this.dateValue : null })), this.rowIndex >= this.minRowCount ? (index.h("div", { class: "delete-button-contianer" }, index.h("pn-button", { ref: el => (this.pnDeleteRowButton = el), small: "true", icon: minus.minus, appearance: "warning", index: this.rowIndex, onClick: () => {
178
+ return (index.h(index.Host, { key: '25ce543d9bad0bb62f02966dc58423dc2f774cde' }, index.h("div", { key: '1271fc6c14cff8b206deab0b1760b446a8563b5e', class: "input-element-row" }, index.h("div", { key: 'a8a585012b82f5b3bb04b293d166f0b8514e36f3', class: "input-container" }, index.h("pn-marketweb-input", { key: '74c1a571e925f0732ac7375c3a7a5d30a2a45bbc', ref: el => (this.pnFirstInputField = el), type: "number", placeholder: this.fristInputPlaceholder, value: this.firstInputValue, min: "1" }), this.showFirstInputLowError || this.showFirstInputHighError || this.showFirstInputWarning ? (index.h("div", { class: "input-element-message-container" }, this.showFirstInputLowError ? (index.h("div", { class: "input-element-message-container__error" }, index.h("small", null, this.firstInputLowErrorText))) : null, this.showFirstInputHighError ? (index.h("div", { class: "input-element-message-container__error" }, index.h("small", null, this.firstInputHighErrorText))) : null, this.showFirstInputWarning ? (index.h("div", { class: "input-element-message-container__warning" }, index.h("small", null, this.firstInputWarningText))) : null)) : null), index.h("div", { key: 'abf3f14c2d3ede9b5a76013c6d5a0994a3d09188', class: "input-container" }, index.h("pn-marketweb-input", { key: '364fd23a48d89932c6ada0a615750f7bd2233098', ref: el => (this.pnSecondInputField = el), type: "number", placeholder: this.secondInputPlaceholder, value: this.secondInputValue, min: "1" }), this.showSecondInputLowError || this.showSecondInputHighError || this.showSecondInputWarning ? (index.h("div", { class: "input-element-message-container" }, this.showSecondInputLowError ? (index.h("div", { class: "input-element-message-container__error" }, index.h("small", null, this.secondInputLowErrorText))) : null, this.showSecondInputHighError ? (index.h("div", { class: "input-element-message-container__error" }, index.h("small", null, this.secondInputHighErrorText))) : null, this.showSecondInputWarning ? (index.h("div", { class: "input-element-message-container__warning" }, index.h("small", null, this.secondInputWarningText))) : null)) : null), index.h("div", { key: '8da4638217aee0b48cfe8bc9371bc588dfc3ac0d', class: "input-container" }, index.h("pn-date-picker", { key: 'afb0f900fe19c4c2d12bd00b72e86b68cd3c7256', ref: el => (this.pnDatePicker = el), range: "false", "disable-weekends": true, "min-date": this.firstValidDate, "max-date": this.lastValidDate, language: this.languageCode, placeholder: this.datePlaceholder, start: this.dateValue?.length ? this.dateValue : null })), this.rowIndex >= this.minRowCount ? (index.h("div", { class: "delete-button-contianer" }, index.h("pn-button", { ref: el => (this.pnDeleteRowButton = el), small: "true", icon: minus.minus, appearance: "warning", index: this.rowIndex, onClick: () => {
179
179
  this.deleteRow();
180
180
  } }, "Delete"))) : null)));
181
181
  }
@@ -1 +1 @@
1
- {"file":"pn-dropdown-with-multi-input-rows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C,MAAM,EACZ,IAAI,EAAEE,WAAK,EACX,UAAU,EAAC,SAAS,EACpB,KAAK,EAAE,IAAI,CAAC,QAAQ,EACpB,OAAO,EAAE;gBACP,IAAI,CAAC,SAAS,EAAE,CAAC;aAClB,aAGS,CACR,IACJ,IAAI,CACJ,CACD,EACP;KACH;;;;;;;;;","names":["debounce","h","Host","minus"],"sources":["src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.scss?tag=pn-dropdown-with-multi-input-rows-row","src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-dropdown-with-multi-input-rows-row {\n .input-element-row {\n display: flex;\n gap: 1rem;\n margin-bottom: 1rem;\n\n .input-container {\n width: 30%;\n\n pn-marketweb-input {\n .input-container {\n width: 100%;\n }\n }\n\n pn-date-picker {\n width: 100%;\n }\n\n .input-element-message-container {\n margin-top: 0.3rem;\n &__error {\n color: red;\n line-height: 1;\n }\n\n &__warning {\n line-height: 1;\n }\n }\n }\n }\n\n .delete-button-contianer {\n margin-top: 0.6rem;\n }\n}\n","import { Component, Prop, h, Element, State, Host, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { FormValue, RowValue, Root, PredefinedValues } from './types';\nimport debounce from 'debounce';\nimport { minus } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-dropdown-with-multi-input-rows-row',\n styleUrl: 'pn-dropdown-with-multi-input-rows-row.scss',\n})\nexport class PnDropdownWithMultiInputRowsRow {\n @Element() hostElement: Element;\n private _predefinedValue: PredefinedValues;\n pnFirstInputField: HTMLElement = null;\n pnSecondInputField: HTMLElement = null;\n pnDatePicker: HTMLElement = null;\n pnDeleteRowButton: HTMLElement = null;\n\n @Prop() languageCode: string = null;\n @Prop() fristInputPlaceholder: string = null;\n @Prop() firstInputMin: number = null;\n @Prop() firstInputMax: number = null;\n @Prop() firstInputWarning: number = null;\n @Prop() firstInputWarningText: string = null;\n @Prop() firstInputLowErrorText: string = null;\n @Prop() firstInputHighErrorText: string = null;\n @Prop() secondInputPlaceholder: string = null;\n @Prop() secondInputMin: number = null;\n @Prop() secondInputMax: number = null;\n @Prop() secondInputWarning: number = null;\n @Prop() secondInputWarningText: string = null;\n @Prop() secondInputLowErrorText: string = null;\n @Prop() secondInputHighErrorText: string = null;\n @Prop() dateLabel: string = null;\n @Prop() datePlaceholder: string = null;\n @Prop() firstValidDate: string = null;\n @Prop() lastValidDate: string = null;\n @Prop() predefinedValue: string = null;\n @Prop() rowIndex: number = null;\n @Prop() minRowCount: number = null;\n\n @State() showFirstInputWarning: boolean = false;\n @State() showFirstInputLowError: boolean = false;\n @State() showFirstInputHighError: boolean = false;\n @State() showSecondInputWarning: boolean = false;\n @State() showSecondInputLowError: boolean = false;\n @State() showSecondInputHighError: boolean = false;\n\n @State() firstInputValue: string = '';\n @State() secondInputValue: string = '';\n @State() dateValue: string = '';\n\n @Event() rowValueChange: EventEmitter<PredefinedValues>;\n @Event() deleteRowEvent: EventEmitter<string>;\n @Event() firstInputChange: EventEmitter<PredefinedValues>;\n @Event() secondInputChange: EventEmitter<PredefinedValues>;\n\n componentWillLoad() {\n this.getPredefinedValues();\n this.setInitialValues();\n }\n\n componentDidLoad() {\n this.addEventHandlers();\n }\n\n getPredefinedValues() {\n this._predefinedValue = JSON.parse(this.predefinedValue);\n }\n\n @Watch('predefinedValue')\n applyPredefinedValue() {\n this.getPredefinedValues();\n this.setInitialValues();\n\n if (this.firstInputValue?.length) {\n this.validateFirstInput(parseInt(this.firstInputValue));\n }\n\n if (this.secondInputValue?.length) {\n this.validateSecondInput(parseInt(this.secondInputValue));\n }\n\n if (this.rowIndex >= this.minRowCount) {\n this.pnDeleteRowButton.addEventListener('click', this.deleteRow.bind(this));\n }\n }\n\n setInitialValues() {\n this.firstInputValue = this._predefinedValue.firstInput;\n this.secondInputValue = this._predefinedValue.secondInput;\n this.dateValue = this._predefinedValue.date;\n }\n\n addEventHandlers() {\n const emmitValues = debounce(this.emitRowValues.bind(this), 500);\n this.pnFirstInputField.addEventListener('keyup', debounce(this.handleFirstInput.bind(this), 500));\n this.pnSecondInputField.addEventListener('keyup', debounce(this.handleSecondInput.bind(this), 500));\n this.pnDatePicker.addEventListener('dateselection', this.handleDateChange.bind(this));\n this.pnDatePicker.addEventListener('dateselection', emmitValues);\n }\n\n handleFirstInput(e) {\n const elm = e.target;\n const value = parseInt(elm.value);\n\n if (value > 0) {\n this.firstInputValue = elm.value;\n this.firstInputChange.emit({\n id: this._predefinedValue.id,\n firstInput: this.firstInputValue,\n secondInput: this.secondInputValue,\n date: this.dateValue,\n });\n }\n\n this.validateFirstInput(value);\n this.emitRowValues();\n }\n\n handleSecondInput(e) {\n const elm = e.target;\n const value = parseInt(elm.value);\n\n if (value > 0) {\n this.secondInputValue = elm.value;\n this.secondInputChange.emit({\n id: this._predefinedValue.id,\n firstInput: this.firstInputValue,\n secondInput: this.secondInputValue,\n date: this.dateValue,\n });\n }\n\n this.validateSecondInput(value);\n this.emitRowValues();\n }\n\n validateFirstInput(input: number) {\n this.showFirstInputWarning = false;\n this.showFirstInputLowError = false;\n this.showFirstInputHighError = false;\n\n if (input < this.firstInputWarning) {\n this.showFirstInputWarning = true;\n }\n\n if (input < this.firstInputMin) {\n this.showFirstInputWarning = false;\n this.showFirstInputLowError = true;\n }\n\n if (input > this.firstInputMax) {\n this.showFirstInputWarning = false;\n this.showFirstInputLowError = false;\n this.showFirstInputHighError = true;\n }\n }\n\n validateSecondInput(input: number) {\n this.showSecondInputWarning = false;\n this.showSecondInputLowError = false;\n this.showSecondInputHighError = false;\n\n if (input < this.secondInputWarning) {\n this.showSecondInputWarning = true;\n }\n\n if (input < this.secondInputMin) {\n this.showSecondInputWarning = false;\n this.showSecondInputLowError = true;\n }\n\n if (input > this.secondInputMax) {\n this.showSecondInputWarning = false;\n this.showSecondInputLowError = false;\n this.showSecondInputHighError = true;\n }\n }\n\n handleDateChange(e) {\n const elm = e.target;\n if (elm === this.pnDatePicker) {\n this.dateValue = e.detail;\n }\n }\n\n emitRowValues() {\n this.rowValueChange.emit({\n id: this._predefinedValue.id,\n firstInput: this.firstInputValue,\n secondInput: this.secondInputValue,\n date: this.dateValue,\n });\n }\n\n deleteRow() {\n this.deleteRowEvent.emit(this._predefinedValue.id);\n }\n\n render() {\n return (\n <Host>\n <div class=\"input-element-row\">\n <div class=\"input-container\">\n <pn-marketweb-input\n ref={el => (this.pnFirstInputField = el as HTMLElement)}\n type=\"number\"\n placeholder={this.fristInputPlaceholder}\n value={this.firstInputValue}\n min=\"1\"\n ></pn-marketweb-input>\n {this.showFirstInputLowError || this.showFirstInputHighError || this.showFirstInputWarning ? (\n <div class=\"input-element-message-container\">\n {this.showFirstInputLowError ? (\n <div class=\"input-element-message-container__error\">\n <small>{this.firstInputLowErrorText}</small>\n </div>\n ) : null}\n\n {this.showFirstInputHighError ? (\n <div class=\"input-element-message-container__error\">\n <small>{this.firstInputHighErrorText}</small>\n </div>\n ) : null}\n\n {this.showFirstInputWarning ? (\n <div class=\"input-element-message-container__warning\">\n <small>{this.firstInputWarningText}</small>\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n\n <div class=\"input-container\">\n <pn-marketweb-input\n ref={el => (this.pnSecondInputField = el as HTMLElement)}\n type=\"number\"\n placeholder={this.secondInputPlaceholder}\n value={this.secondInputValue}\n min=\"1\"\n ></pn-marketweb-input>\n {this.showSecondInputLowError || this.showSecondInputHighError || this.showSecondInputWarning ? (\n <div class=\"input-element-message-container\">\n {this.showSecondInputLowError ? (\n <div class=\"input-element-message-container__error\">\n <small>{this.secondInputLowErrorText}</small>\n </div>\n ) : null}\n\n {this.showSecondInputHighError ? (\n <div class=\"input-element-message-container__error\">\n <small>{this.secondInputHighErrorText}</small>\n </div>\n ) : null}\n\n {this.showSecondInputWarning ? (\n <div class=\"input-element-message-container__warning\">\n <small>{this.secondInputWarningText}</small>\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n\n <div class=\"input-container\">\n <pn-date-picker\n ref={el => (this.pnDatePicker = el as HTMLElement)}\n range=\"false\"\n disable-weekends={true}\n min-date={this.firstValidDate}\n max-date={this.lastValidDate}\n language={this.languageCode}\n placeholder={this.datePlaceholder}\n start={this.dateValue?.length ? this.dateValue : null}\n ></pn-date-picker>\n </div>\n\n {this.rowIndex >= this.minRowCount ? (\n <div class=\"delete-button-contianer\">\n <pn-button\n ref={el => (this.pnDeleteRowButton = el as HTMLElement)}\n small=\"true\"\n icon={minus}\n appearance=\"warning\"\n index={this.rowIndex}\n onClick={() => {\n this.deleteRow();\n }}\n >\n Delete\n </pn-button>\n </div>\n ) : null}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pn-dropdown-with-multi-input-rows-row.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,kCAAkC,GAAG,87BAA87B,CAAC;AAC1+B,8CAAe,kCAAkC;;MCQpC,+BAA+B;;;;;;;4BAQX,IAAI;qCACK,IAAI;6BACZ,IAAI;6BACJ,IAAI;iCACA,IAAI;qCACA,IAAI;sCACH,IAAI;uCACH,IAAI;sCACL,IAAI;8BACZ,IAAI;8BACJ,IAAI;kCACA,IAAI;sCACA,IAAI;uCACH,IAAI;wCACH,IAAI;yBACnB,IAAI;+BACE,IAAI;8BACL,IAAI;6BACL,IAAI;+BACF,IAAI;wBACX,IAAI;2BACD,IAAI;qCAEQ,KAAK;sCACJ,KAAK;uCACJ,KAAK;sCACN,KAAK;uCACJ,KAAK;wCACJ,KAAK;+BAEf,EAAE;gCACD,EAAE;yBACT,EAAE;;;IAtCvB,gBAAgB,CAAmB;IAC3C,iBAAiB,GAAgB,IAAI,CAAC;IACtC,kBAAkB,GAAgB,IAAI,CAAC;IACvC,YAAY,GAAgB,IAAI,CAAC;IACjC,iBAAiB,GAAgB,IAAI,CAAC;IAoC7B,cAAc,CAAiC;IAC/C,cAAc,CAAuB;IACrC,gBAAgB,CAAiC;IACjD,iBAAiB,CAA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,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,YAAY,GAAG,EAAiB,CAAC,EAClD,KAAK,EAAC,OAAO,sBACK,IAAI,cACZ,IAAI,CAAC,cAAc,cACnB,IAAI,CAAC,aAAa,EAC5B,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,WAAW,EAAE,IAAI,CAAC,eAAe,EACjC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,GACrC,CACd,EAEL,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,IAChCA,iBAAK,KAAK,EAAC,yBAAyB,IAClCA,uBACE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,iBAAiB,GAAG,EAAiB,CAAC,EACvD,KAAK,EAAC,MAAM,EACZ,IAAI,EAAEE,WAAK,EACX,UAAU,EAAC,SAAS,EACpB,KAAK,EAAE,IAAI,CAAC,QAAQ,EACpB,OAAO,EAAE;gBACP,IAAI,CAAC,SAAS,EAAE,CAAC;aAClB,aAGS,CACR,IACJ,IAAI,CACJ,CACD,EACP;KACH;;;;;;;;;","names":["debounce","h","Host","minus"],"sources":["src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.scss?tag=pn-dropdown-with-multi-input-rows-row","src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-dropdown-with-multi-input-rows-row {\n .input-element-row {\n display: flex;\n gap: 1rem;\n margin-bottom: 1rem;\n\n .input-container {\n width: 30%;\n\n pn-marketweb-input {\n .input-container {\n width: 100%;\n }\n }\n\n pn-date-picker {\n width: 100%;\n }\n\n .input-element-message-container {\n margin-top: 0.3rem;\n &__error {\n color: red;\n line-height: 1;\n }\n\n &__warning {\n line-height: 1;\n }\n }\n }\n }\n\n .delete-button-contianer {\n margin-top: 0.6rem;\n }\n}\n","import { Component, Prop, h, Element, State, Host, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { FormValue, RowValue, Root, PredefinedValues } from './types';\nimport debounce from 'debounce';\nimport { minus } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-dropdown-with-multi-input-rows-row',\n styleUrl: 'pn-dropdown-with-multi-input-rows-row.scss',\n})\nexport class PnDropdownWithMultiInputRowsRow {\n @Element() hostElement: Element;\n private _predefinedValue: PredefinedValues;\n pnFirstInputField: HTMLElement = null;\n pnSecondInputField: HTMLElement = null;\n pnDatePicker: HTMLElement = null;\n pnDeleteRowButton: HTMLElement = null;\n\n @Prop() languageCode: string = null;\n @Prop() fristInputPlaceholder: string = null;\n @Prop() firstInputMin: number = null;\n @Prop() firstInputMax: number = null;\n @Prop() firstInputWarning: number = null;\n @Prop() firstInputWarningText: string = null;\n @Prop() firstInputLowErrorText: string = null;\n @Prop() firstInputHighErrorText: string = null;\n @Prop() secondInputPlaceholder: string = null;\n @Prop() secondInputMin: number = null;\n @Prop() secondInputMax: number = null;\n @Prop() secondInputWarning: number = null;\n @Prop() secondInputWarningText: string = null;\n @Prop() secondInputLowErrorText: string = null;\n @Prop() secondInputHighErrorText: string = null;\n @Prop() dateLabel: string = null;\n @Prop() datePlaceholder: string = null;\n @Prop() firstValidDate: string = null;\n @Prop() lastValidDate: string = null;\n @Prop() predefinedValue: string = null;\n @Prop() rowIndex: number = null;\n @Prop() minRowCount: number = null;\n\n @State() showFirstInputWarning: boolean = false;\n @State() showFirstInputLowError: boolean = false;\n @State() showFirstInputHighError: boolean = false;\n @State() showSecondInputWarning: boolean = false;\n @State() showSecondInputLowError: boolean = false;\n @State() showSecondInputHighError: boolean = false;\n\n @State() firstInputValue: string = '';\n @State() secondInputValue: string = '';\n @State() dateValue: string = '';\n\n @Event() rowValueChange: EventEmitter<PredefinedValues>;\n @Event() deleteRowEvent: EventEmitter<string>;\n @Event() firstInputChange: EventEmitter<PredefinedValues>;\n @Event() secondInputChange: EventEmitter<PredefinedValues>;\n\n componentWillLoad() {\n this.getPredefinedValues();\n this.setInitialValues();\n }\n\n componentDidLoad() {\n this.addEventHandlers();\n }\n\n getPredefinedValues() {\n this._predefinedValue = JSON.parse(this.predefinedValue);\n }\n\n @Watch('predefinedValue')\n applyPredefinedValue() {\n this.getPredefinedValues();\n this.setInitialValues();\n\n if (this.firstInputValue?.length) {\n this.validateFirstInput(parseInt(this.firstInputValue));\n }\n\n if (this.secondInputValue?.length) {\n this.validateSecondInput(parseInt(this.secondInputValue));\n }\n\n if (this.rowIndex >= this.minRowCount) {\n this.pnDeleteRowButton.addEventListener('click', this.deleteRow.bind(this));\n }\n }\n\n setInitialValues() {\n this.firstInputValue = this._predefinedValue.firstInput;\n this.secondInputValue = this._predefinedValue.secondInput;\n this.dateValue = this._predefinedValue.date;\n }\n\n addEventHandlers() {\n const emmitValues = debounce(this.emitRowValues.bind(this), 500);\n this.pnFirstInputField.addEventListener('keyup', debounce(this.handleFirstInput.bind(this), 500));\n this.pnSecondInputField.addEventListener('keyup', debounce(this.handleSecondInput.bind(this), 500));\n this.pnDatePicker.addEventListener('dateselection', this.handleDateChange.bind(this));\n this.pnDatePicker.addEventListener('dateselection', emmitValues);\n }\n\n handleFirstInput(e) {\n const elm = e.target;\n const value = parseInt(elm.value);\n\n if (value > 0) {\n this.firstInputValue = elm.value;\n this.firstInputChange.emit({\n id: this._predefinedValue.id,\n firstInput: this.firstInputValue,\n secondInput: this.secondInputValue,\n date: this.dateValue,\n });\n }\n\n this.validateFirstInput(value);\n this.emitRowValues();\n }\n\n handleSecondInput(e) {\n const elm = e.target;\n const value = parseInt(elm.value);\n\n if (value > 0) {\n this.secondInputValue = elm.value;\n this.secondInputChange.emit({\n id: this._predefinedValue.id,\n firstInput: this.firstInputValue,\n secondInput: this.secondInputValue,\n date: this.dateValue,\n });\n }\n\n this.validateSecondInput(value);\n this.emitRowValues();\n }\n\n validateFirstInput(input: number) {\n this.showFirstInputWarning = false;\n this.showFirstInputLowError = false;\n this.showFirstInputHighError = false;\n\n if (input < this.firstInputWarning) {\n this.showFirstInputWarning = true;\n }\n\n if (input < this.firstInputMin) {\n this.showFirstInputWarning = false;\n this.showFirstInputLowError = true;\n }\n\n if (input > this.firstInputMax) {\n this.showFirstInputWarning = false;\n this.showFirstInputLowError = false;\n this.showFirstInputHighError = true;\n }\n }\n\n validateSecondInput(input: number) {\n this.showSecondInputWarning = false;\n this.showSecondInputLowError = false;\n this.showSecondInputHighError = false;\n\n if (input < this.secondInputWarning) {\n this.showSecondInputWarning = true;\n }\n\n if (input < this.secondInputMin) {\n this.showSecondInputWarning = false;\n this.showSecondInputLowError = true;\n }\n\n if (input > this.secondInputMax) {\n this.showSecondInputWarning = false;\n this.showSecondInputLowError = false;\n this.showSecondInputHighError = true;\n }\n }\n\n handleDateChange(e) {\n const elm = e.target;\n if (elm === this.pnDatePicker) {\n this.dateValue = e.detail.start;\n }\n }\n\n emitRowValues() {\n this.rowValueChange.emit({\n id: this._predefinedValue.id,\n firstInput: this.firstInputValue,\n secondInput: this.secondInputValue,\n date: this.dateValue,\n });\n }\n\n deleteRow() {\n this.deleteRowEvent.emit(this._predefinedValue.id);\n }\n\n render() {\n return (\n <Host>\n <div class=\"input-element-row\">\n <div class=\"input-container\">\n <pn-marketweb-input\n ref={el => (this.pnFirstInputField = el as HTMLElement)}\n type=\"number\"\n placeholder={this.fristInputPlaceholder}\n value={this.firstInputValue}\n min=\"1\"\n ></pn-marketweb-input>\n {this.showFirstInputLowError || this.showFirstInputHighError || this.showFirstInputWarning ? (\n <div class=\"input-element-message-container\">\n {this.showFirstInputLowError ? (\n <div class=\"input-element-message-container__error\">\n <small>{this.firstInputLowErrorText}</small>\n </div>\n ) : null}\n\n {this.showFirstInputHighError ? (\n <div class=\"input-element-message-container__error\">\n <small>{this.firstInputHighErrorText}</small>\n </div>\n ) : null}\n\n {this.showFirstInputWarning ? (\n <div class=\"input-element-message-container__warning\">\n <small>{this.firstInputWarningText}</small>\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n\n <div class=\"input-container\">\n <pn-marketweb-input\n ref={el => (this.pnSecondInputField = el as HTMLElement)}\n type=\"number\"\n placeholder={this.secondInputPlaceholder}\n value={this.secondInputValue}\n min=\"1\"\n ></pn-marketweb-input>\n {this.showSecondInputLowError || this.showSecondInputHighError || this.showSecondInputWarning ? (\n <div class=\"input-element-message-container\">\n {this.showSecondInputLowError ? (\n <div class=\"input-element-message-container__error\">\n <small>{this.secondInputLowErrorText}</small>\n </div>\n ) : null}\n\n {this.showSecondInputHighError ? (\n <div class=\"input-element-message-container__error\">\n <small>{this.secondInputHighErrorText}</small>\n </div>\n ) : null}\n\n {this.showSecondInputWarning ? (\n <div class=\"input-element-message-container__warning\">\n <small>{this.secondInputWarningText}</small>\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n\n <div class=\"input-container\">\n <pn-date-picker\n ref={el => (this.pnDatePicker = el as HTMLElement)}\n range=\"false\"\n disable-weekends={true}\n min-date={this.firstValidDate}\n max-date={this.lastValidDate}\n language={this.languageCode}\n placeholder={this.datePlaceholder}\n start={this.dateValue?.length ? this.dateValue : null}\n ></pn-date-picker>\n </div>\n\n {this.rowIndex >= this.minRowCount ? (\n <div class=\"delete-button-contianer\">\n <pn-button\n ref={el => (this.pnDeleteRowButton = el as HTMLElement)}\n small=\"true\"\n icon={minus}\n appearance=\"warning\"\n index={this.rowIndex}\n onClick={() => {\n this.deleteRow();\n }}\n >\n Delete\n </pn-button>\n </div>\n ) : null}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -11,6 +11,16 @@ const pnDropdownWithMultiInputRowsCss = "pn-button-dropdown .pn-button-dropdown>
11
11
  const PnDropdownWithMultiInputRowsStyle0 = pnDropdownWithMultiInputRowsCss;
12
12
 
13
13
  const PnDropdownWithMultiInputRows = class {
14
+ get hostElement() { return index.getElement(this); }
15
+ pnFirstDropdown = null;
16
+ pnSecondDropdown = null;
17
+ pnSumField = null;
18
+ pnConfirmDeleteButton = null;
19
+ pnAbortDeleteButton = null;
20
+ allFormValues;
21
+ _firstDropdownSelection = null;
22
+ _secondDropdownSelection = null;
23
+ _defaultRow;
14
24
  constructor(hostRef) {
15
25
  index.registerInstance(this, hostRef);
16
26
  this.allFormValues = index.createEvent(this, "allFormValues", 7);
@@ -57,22 +67,13 @@ const PnDropdownWithMultiInputRows = class {
57
67
  this.rowSum = null;
58
68
  this.minRowCount = null;
59
69
  this.showDelteConfirm = false;
70
+ this._defaultRow = {
71
+ id: this.generateUniqueId(),
72
+ firstInput: '',
73
+ secondInput: this.secondInputWarning !== null ? this.secondInputWarning.toString() : '',
74
+ date: '',
75
+ };
60
76
  }
61
- get hostElement() { return index.getElement(this); }
62
- pnFirstDropdown = null;
63
- pnSecondDropdown = null;
64
- pnSumField = null;
65
- pnConfirmDeleteButton = null;
66
- pnAbortDeleteButton = null;
67
- allFormValues;
68
- _firstDropdownSelection = null;
69
- _secondDropdownSelection = null;
70
- _defaultRow = {
71
- id: this.generateUniqueId(),
72
- firstInput: '',
73
- secondInput: this.secondInputWarning.toString(),
74
- date: '',
75
- };
76
77
  componentWillLoad() {
77
78
  this.formValues = [];
78
79
  this.setDropDownData();
@@ -165,7 +166,7 @@ const PnDropdownWithMultiInputRows = class {
165
166
  this.dropdownDataRoot.forEach(element => {
166
167
  element.checked = false;
167
168
  });
168
- const selectionRoot = this.dropdownDataRoot.find(x => x.label === selectedValue);
169
+ const selectionRoot = this.dropdownDataRoot.find(x => x.value?.toString() === selectedValue);
169
170
  selectionRoot.checked = true;
170
171
  this._firstDropdownSelection = selectionRoot.label;
171
172
  this.minRowCount = selectionRoot.value;
@@ -288,7 +289,7 @@ const PnDropdownWithMultiInputRows = class {
288
289
  const secondInputValue = { name: this.secondInputLabel, value: item.secondInput };
289
290
  rowValue.row.push(secondInputValue);
290
291
  }
291
- if (item.date?.length) {
292
+ if (item.date) {
292
293
  const dateValue = { name: this.dateLabel, value: item.date };
293
294
  rowValue.row.push(dateValue);
294
295
  }
@@ -305,9 +306,9 @@ const PnDropdownWithMultiInputRows = class {
305
306
  }
306
307
  }
307
308
  render() {
308
- return (index.h(index.Host, { key: 'db917d14641b4a13e6ed4d3a56f4b9ea52a8e0c1', class: "dropdown-with-multi-input-elemet" }, index.h("div", { key: 'bdc73044cdb1e6a791b9965086971ecbb796719d', class: "dropdown-with-multi-input-elemet__row" }, index.h("div", { key: 'b605ca3179d5884577c78abddf1b9a572a78b927' }, index.h("pn-select", { key: '285e9e9af4ed230b3f854b565ff7e56ef0b6dafe', ref: el => (this.pnFirstDropdown = el), class: "pn-row-select-dropdown dropDown1-dropdown", label: this.firstDropdownLabel, "empty-option": "true", language: this.languageCode }, this.dropdownDataRoot?.map((item, i) => (index.h("pn-option", { index: i, label: item.value, value: item.value, selected: item.checked, onClick: index$1.debounce(this.handleFirstDropdown.bind(this), 500) })))), this.firstDropdownHelperText?.length ? index.h("small", null, this.firstDropdownHelperText) : null)), index.h("div", { key: '5f3e0a81ac3d2588d5ed1f00626459f24c0ef935', class: "dropdown-with-multi-input-elemet__row" }, index.h("div", { key: 'f6294437827f047a391ff6d9270108510030aba7' }, index.h("pn-select", { key: '145d9f5a698a03ff3334752446f0b5d6d4d7f7b9', ref: el => (this.pnSecondDropdown = el), class: "pn-row-select-dropdown dropDown2-dropdown", label: this.secondDropdownLabel, "empty-option": "true", language: this.languageCode }, this.secondDropdownArr?.map((item, i) => (index.h("pn-option", { index: i, label: item, value: item, selected: item === this._secondDropdownSelection, onClick: index$1.debounce(this.handleSecondDropdown.bind(this), 500) })))), this.secondDropdownHelperText?.length ? index.h("small", null, this.secondDropdownHelperText) : null)), this.showDelteConfirm ? (index.h("div", { class: "dropdown-with-multi-input-elemet__delete" }, index.h("p", null, this.deleteMultipleRowsWarningText), index.h("pn-button", { ref: el => (this.pnConfirmDeleteButton = el), small: "true", appearance: "warning", onClick: this.deleteExcessRows.bind(this) }, this.confirmDeleteButtonText), index.h("pn-button", { ref: el => (this.pnAbortDeleteButton = el), small: "true", appearance: "light", onClick: this.abortDeleteRows.bind(this) }, this.abortDeleteButtonText))) : null, index.h("div", { key: '47bf41463c9cc5610af5b0b55b359fa999f5e310', class: "dropdown-with-multi-input-elemet__label-row" }, index.h("div", { key: '042ca6ea6e592855d2bad4a0c4b5805b7558615f', class: "dropdown-with-multi-input-elemet__label" }, index.h("label", { key: 'c83575c3261780ae981bcc4a258a1a32e929e22a' }, this.fristInputLabel)), index.h("div", { key: '08cb056b391c65a347f35b813c12b8b79c46376d', class: "dropdown-with-multi-input-elemet__label" }, index.h("label", { key: '595f9d11e057363dbe21ed9bcdee704554d5b989' }, this.secondInputLabel)), index.h("div", { key: 'd41c98201f1c3c8d758e9ee89517b56a15c968ad', class: "dropdown-with-multi-input-elemet__label" }, index.h("label", { key: '9bab0729cad8b23b599bcafd3e71659bdb7b23ed' }, this.dateLabel))), this.rowData?.map((data, i) => {
309
+ return (index.h(index.Host, { key: '0a39e32ed3f2a2a59f5b9d9a5e4841a03f8ebef3', class: "dropdown-with-multi-input-elemet" }, index.h("div", { key: 'aa6de4df4b8bc9be801539b9839b9e090088c589', class: "dropdown-with-multi-input-elemet__row" }, index.h("div", { key: 'b8d7dc7e35aeb5b92f08393eb829d390e15f3abe' }, index.h("pn-select", { key: '7d30c9249a523e4b9a8a4435668cc37dee57398d', ref: el => (this.pnFirstDropdown = el), class: "pn-row-select-dropdown dropDown1-dropdown", label: this.firstDropdownLabel, "empty-option": "true", language: this.languageCode }, this.dropdownDataRoot?.map((item, i) => (index.h("pn-option", { index: i, label: item.value, value: item.value, selected: item.checked, onClick: index$1.debounce(this.handleFirstDropdown.bind(this), 500) })))), this.firstDropdownHelperText?.length ? index.h("small", null, this.firstDropdownHelperText) : null)), index.h("div", { key: 'd1732d071e4244f3c27a52db59b6bb74015ba28b', class: "dropdown-with-multi-input-elemet__row" }, index.h("div", { key: '4c57f1f5048669473f326476735b8440535a1aa2' }, index.h("pn-select", { key: '58980dea2e4545efe141837a8454f0860505bb6f', ref: el => (this.pnSecondDropdown = el), class: "pn-row-select-dropdown dropDown2-dropdown", label: this.secondDropdownLabel, "empty-option": "true", language: this.languageCode }, this.secondDropdownArr?.map((item, i) => (index.h("pn-option", { index: i, label: item, value: item, selected: item === this._secondDropdownSelection, onClick: index$1.debounce(this.handleSecondDropdown.bind(this), 500) })))), this.secondDropdownHelperText?.length ? index.h("small", null, this.secondDropdownHelperText) : null)), this.showDelteConfirm ? (index.h("div", { class: "dropdown-with-multi-input-elemet__delete" }, index.h("p", null, this.deleteMultipleRowsWarningText), index.h("pn-button", { ref: el => (this.pnConfirmDeleteButton = el), small: "true", appearance: "warning", onClick: this.deleteExcessRows.bind(this) }, this.confirmDeleteButtonText), index.h("pn-button", { ref: el => (this.pnAbortDeleteButton = el), small: "true", appearance: "light", onClick: this.abortDeleteRows.bind(this) }, this.abortDeleteButtonText))) : null, index.h("div", { key: '023ffe29ad8465a3c139903f44f8d825290f0946', class: "dropdown-with-multi-input-elemet__label-row" }, index.h("div", { key: '7a590ad0801b14933b1104b9e7d10d595174d194', class: "dropdown-with-multi-input-elemet__label" }, index.h("label", { key: '352cca674f5282f4ad0e3c0aec8307e23288b9ca' }, this.fristInputLabel)), index.h("div", { key: '6cc82e56ca355d23dfe1bdaf814875f1c02cebd7', class: "dropdown-with-multi-input-elemet__label" }, index.h("label", { key: '3421119a657ec0891c1c429a73ed5c092f80f18d' }, this.secondInputLabel)), index.h("div", { key: '9ad9a6e01eb8d5ac2788a22e42ae240f570566a0', class: "dropdown-with-multi-input-elemet__label" }, index.h("label", { key: '6909d759977802e1cedeb92c35dfee9ffc12c01d' }, this.dateLabel))), this.rowData?.map((data, i) => {
309
310
  return (index.h("div", { class: 'dropdown-with-multi-input-elemet__row generated-row-' + i, id: 'generated-row-' + i }, index.h("pn-dropdown-with-multi-input-rows-row", { "language-code": this.languageCode, "frist-input-placeholder": this.fristInputPlaceholder, "first-input-min": this.firstInputMin, "first-input-max": this.firstInputMax, "first-input-warning": this.firstInputWarning, "first-input-warning-text": this.firstInputWarningText, "first-input-low-error-text": this.firstInputLowErrorText, "first-input-high-error-text": this.firstInputHighErrorText, "second-input-placeholder": this.secondInputPlaceholder, "second-input-min": this.secondInputMin, "second-input-max": this.secondInputMax, "second-input-warning": this.secondInputWarning, "second-input-warning-text": this.secondInputWarningText, "second-input-low-error-text": this.secondInputLowErrorText, "second-input-high-error-text": this.secondInputHighErrorText, datePlaceholder: this.datePlaceholder, firstValidDate: this.firstValidDateString, lastValidDate: this.lastValidDateString, "predefined-value": JSON.stringify(data), "min-row-count": this.minRowCount, "row-index": i })));
310
- }), index.h("div", { key: '42c184b29e1bad6f15ebc5fe3d68f67d9a5ad8d1', class: "dropdown-with-multi-input-elemet__row sum-row" }, index.h("pn-marketweb-input", { key: '225bb8ad477257903a6fcc18b2d72824536f0609', disabled: true, ref: el => (this.pnSumField = el), type: "number", value: this.rowSum, label: this.sumFieldLabel }), index.h("pn-button", { key: '4ecc69b7350ddc7792160c46ec9acff12c4c8482', tooltip: this.addRowText ? this.addRowText : null, "left-icon": "true", arialabel: "Add", icon: plus.plus, appearance: "light", variant: "borderless", class: "connected-dropdown__button-right", onClick: () => {
311
+ }), index.h("div", { key: '878ef1b83a0090520ab84450a1b80b0c5529a610', class: "dropdown-with-multi-input-elemet__row sum-row" }, index.h("pn-marketweb-input", { key: 'aab23b9eb8616d1e737ddc8bfd06dcc56d89bf72', disabled: true, ref: el => (this.pnSumField = el), type: "number", value: this.rowSum, label: this.sumFieldLabel }), index.h("pn-button", { key: '1c98a7886cad539d6fea5689696006850fff6d5b', tooltip: this.addRowText ? this.addRowText : null, "left-icon": "true", arialabel: "Add", icon: plus.plus, appearance: "light", variant: "borderless", class: "connected-dropdown__button-right", onClick: () => {
311
312
  this.addRow(this.generateUniqueId());
312
313
  } }, this.addRowText)), this.elementHelperText?.length ? index.h("div", { class: "dropdown-with-multi-input-elemet__row" }, this.elementHelperText) : null));
313
314
  }
@@ -1 +1 @@
1
- {"file":"pn-dropdown-with-multi-input-rows.entry.cjs.js","mapp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AAG,IAAI,CACrH,EACP;KACH;;;;;;","names":["uuidv4","h","Host","debounce","plus"],"sources":["src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.scss?tag=pn-dropdown-with-multi-input-rows","src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-dropdown-with-multi-input-rows {\n .dropdown-with-multi-input-elemet {\n &__row {\n margin-bottom: 1rem;\n }\n\n &__delete {\n display: flex;\n gap: 1rem;\n margin-bottom: 1rem;\n padding: 1rem;\n background-color: $gray25;\n\n pn-button {\n margin-top: 0.9rem;\n }\n }\n\n &__label-row {\n display: flex;\n gap: 1rem;\n }\n\n &__label {\n width: 30%;\n font-size: 0.875em;\n color: #5e554a;\n }\n }\n\n .sum-row {\n display: flex;\n justify-content: space-between;\n }\n}\n","import { Component, Prop, h, Element, State, Host, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { FormValue, RowValue, Root, PredefinedValues } from './types';\nimport { v4 as uuidv4 } from 'uuid';\nimport debounce from 'debounce';\nimport { plus } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-dropdown-with-multi-input-rows',\n styleUrl: 'pn-dropdown-with-multi-input-rows.scss',\n})\nexport class PnDropdownWithMultiInputRows {\n @Element() hostElement: Element;\n pnFirstDropdown: HTMLElement = null;\n pnSecondDropdown: HTMLElement = null;\n pnSumField: HTMLElement = null;\n pnConfirmDeleteButton: HTMLElement = null;\n pnAbortDeleteButton: HTMLElement = null;\n\n @Prop() dropdownData: string | Root[] = null;\n @Prop() languageCode: string = null;\n @Prop() firstDropdownLabel: string = null;\n @Prop() firstDropdownHelperText: string = null;\n @Prop() secondDropdownLabel: string = null;\n @Prop() secondDropdownHelperText: string = null;\n @Prop() secondDropdownMax: number = null;\n @Prop() deleteMultipleRowsWarningText: string = null;\n @Prop() confirmDeleteButtonText: string = null;\n @Prop() abortDeleteButtonText: string = null;\n @Prop() fristInputLabel: string = null;\n @Prop() fristInputPlaceholder: string = null;\n @Prop() firstInputMin: number = null;\n @Prop() firstInputMax: number = null;\n @Prop() firstInputWarning: number = null;\n @Prop() firstInputWarningText: string = null;\n @Prop() firstInputLowErrorText: string = null;\n @Prop() firstInputHighErrorText: string = null;\n @Prop() secondInputLabel: string = null;\n @Prop() secondInputPlaceholder: string = null;\n @Prop() secondInputMin: number = null;\n @Prop() secondInputMax: number = null;\n @Prop() secondInputWarning: number = null;\n @Prop() secondInputWarningText: string = null;\n @Prop() secondInputLowErrorText: string = null;\n @Prop() secondInputHighErrorText: string = null;\n @Prop() dateLabel: string = null;\n @Prop() datePlaceholder: string = null;\n @Prop() dateDaysFromToday: number = 1;\n @Prop() yearsToAddToEndDate: number = null;\n @Prop() sumFieldLabel: string = null;\n @Prop() addRowText: string = null;\n @Prop() elementHelperText: string = null;\n\n @State() dropdownDataRoot: Root[] = null;\n @State() secondDropdownArr: number[] = [];\n @State() rowCount: number = null;\n @State() rowData: PredefinedValues[] = null;\n @State() formValues: FormValue[] = null;\n @State() firstValidDateString: string = '';\n @State() lastValidDateString: string = '';\n @State() rowSum: string = null;\n @State() minRowCount: number = null;\n @State() showDelteConfirm: boolean = false;\n\n @Event() allFormValues: EventEmitter<string>;\n\n private _firstDropdownSelection: string = null;\n private _secondDropdownSelection: number = null;\n\n private _defaultRow: PredefinedValues = {\n id: this.generateUniqueId(),\n firstInput: '',\n secondInput: this.secondInputWarning.toString(),\n date: '',\n };\n\n componentWillLoad() {\n this.formValues = [];\n this.setDropDownData();\n this.updateSecondDropdown();\n this.setRowData();\n this.setFirstValidDate();\n }\n\n componentDidLoad() {\n this.updateSum();\n }\n\n setDropDownData() {\n if (typeof this.dropdownData === 'string') {\n this.dropdownDataRoot = JSON.parse(this.dropdownData);\n } else {\n this.dropdownDataRoot = this.dropdownData;\n }\n\n if (this.dropdownDataRoot?.length) {\n this.dropdownDataRoot.forEach(element => {\n if (!element.value) {\n element.value = 0;\n }\n });\n }\n\n if (this.dropdownDataRoot.length > 0) {\n this.dropdownDataRoot[0].checked = true;\n this._firstDropdownSelection = this.dropdownDataRoot[0].label;\n this._secondDropdownSelection = this.dropdownDataRoot[0].value;\n this.minRowCount = this.dropdownDataRoot[0].value;\n }\n }\n\n updateSecondDropdown() {\n const selectedItem = this.dropdownDataRoot.find(arr => arr.checked === true);\n this.secondDropdownArr = [];\n\n for (let index = selectedItem.value; index <= this.secondDropdownMax; index++) {\n this.secondDropdownArr.push(index);\n }\n }\n\n updateSelectItemArr(arr: Root[], caption: string) {\n arr.forEach(item => {\n if (item.label === caption) {\n item.checked = !item.checked;\n } else {\n item.checked = false;\n }\n });\n return arr;\n }\n\n setRowData() {\n this.rowData = [];\n for (let index = 0; index < this._secondDropdownSelection; index++) {\n const row = Object.assign({}, this._defaultRow);\n row.id = this.generateUniqueId();\n this.rowData = [...this.rowData, row];\n }\n\n this.rowCount = this.rowData.length;\n }\n\n generateUniqueId() {\n return uuidv4();\n }\n\n setFirstValidDate() {\n const yearsToadd = this.yearsToAddToEndDate ? this.yearsToAddToEndDate : 2;\n const date = new Date();\n date.setDate(date.getDate() + this.dateDaysFromToday ?? 0);\n\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n const endYear = year + yearsToadd;\n\n this.firstValidDateString = `${year.toString()}-${month}-${day}`;\n this.lastValidDateString = `${endYear.toString()}-${month}-${day}`;\n }\n\n addRow(newRowId: string) {\n const newRow = Object.assign({}, this.rowData[0]);\n newRow.id = newRowId ? newRowId : this.generateUniqueId();\n newRow.date = '';\n this.rowData = [...this.rowData, newRow];\n this.rowCount = this.rowData.length;\n\n this._secondDropdownSelection = this.rowCount;\n this.secondDropdownArr = [...this.secondDropdownArr];\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n handleFirstDropdown() {\n const selected = this.pnFirstDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n\n this.dropdownDataRoot.forEach(element => {\n element.checked = false;\n });\n\n const selectionRoot = this.dropdownDataRoot.find(x => x.label === selectedValue);\n selectionRoot.checked = true;\n this._firstDropdownSelection = selectionRoot.label;\n this.minRowCount = selectionRoot.value;\n\n if (selectionRoot.value > this._secondDropdownSelection) {\n this.dropdownDataRoot = [...this.dropdownDataRoot];\n\n for (let index = this.rowCount; index < selectionRoot.value; index++) {\n this.addRow(this.generateUniqueId());\n }\n }\n\n this.updateSecondDropdown();\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n handleSecondDropdown() {\n const selected = this.pnSecondDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n\n const value = parseInt(selectedValue);\n if (value < this._secondDropdownSelection) {\n this.showDelteConfirm = true;\n } else {\n for (let index = this.rowCount; index < value; index++) {\n this.addRow(this.generateUniqueId());\n }\n }\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n @Listen('rowValueChange')\n @Listen('firstInputChange')\n @Listen('secondInputChange')\n predefinedValueChange(e) {\n const indexToUpdate = this.rowData.findIndex(data => data.id === e.detail.id);\n const val: PredefinedValues = e.detail;\n this.rowData[indexToUpdate] = {\n ...this.rowData[indexToUpdate],\n firstInput: val.firstInput,\n secondInput: val.secondInput,\n date: val.date,\n };\n\n if (e.type === 'firstInputChange' && indexToUpdate === 0) {\n this.updateFirstInputOfRows(val.firstInput);\n }\n\n if (e.type === 'secondInputChange' && indexToUpdate === 0) {\n this.updateSecondInputOfRows(val.secondInput);\n }\n\n this.rowData = [...this.rowData];\n this.emitValuesIfValid();\n this.updateSum();\n }\n\n updateFirstInputOfRows(value: string) {\n for (let index = 1; index < this.rowCount; index++) {\n this.rowData[index] = {\n ...this.rowData[index],\n firstInput: value,\n };\n }\n }\n\n updateSecondInputOfRows(value: string) {\n for (let index = 1; index < this.rowCount; index++) {\n this.rowData[index] = {\n ...this.rowData[index],\n secondInput: value,\n };\n }\n }\n\n @Listen('deleteRowEvent')\n deleteRowEvent(e) {\n const indexToRemove = this.rowData.findIndex(data => data.id === e.detail);\n if (indexToRemove < 0) {\n return;\n }\n\n this.rowData.splice(indexToRemove, 1);\n this.rowData = [...this.rowData];\n this.rowCount = this.rowData.length;\n\n this._secondDropdownSelection = this.rowCount;\n this.secondDropdownArr = [...this.secondDropdownArr];\n this.emitValuesIfValid();\n this.updateSum();\n }\n\n updateSum() {\n this.rowSum = '';\n let sum = 0;\n this.rowData.forEach(element => {\n if (element?.firstInput?.length) {\n sum += parseInt(element.firstInput);\n }\n });\n\n this.rowSum = sum.toString();\n }\n\n deleteExcessRows() {\n const selected = this.pnSecondDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n const rowsToDelete = this.rowCount - parseInt(selectedValue);\n for (let index = 0; index < rowsToDelete; index++) {\n this.rowData.pop();\n }\n this.rowData = [...this.rowData];\n this.showDelteConfirm = false;\n this.updateSum();\n }\n\n abortDeleteRows() {\n this.showDelteConfirm = false;\n }\n\n emitValuesIfValid() {\n this.formValues = [];\n this.rowData.forEach(item => {\n const rowValue: FormValue = { row: [] };\n\n if (this._firstDropdownSelection?.length) {\n const dropDownValue: RowValue = { name: this.firstDropdownLabel, value: this._firstDropdownSelection };\n rowValue.row.push(dropDownValue);\n }\n\n if (item.firstInput?.length) {\n const firstInputValue: RowValue = { name: this.fristInputLabel, value: item.firstInput };\n rowValue.row.push(firstInputValue);\n }\n\n if (item.secondInput?.length) {\n const secondInputValue: RowValue = { name: this.secondInputLabel, value: item.secondInput };\n rowValue.row.push(secondInputValue);\n }\n\n if (item.date?.length) {\n const dateValue: RowValue = { name: this.dateLabel, value: item.date };\n rowValue.row.push(dateValue);\n }\n\n if (rowValue.row.length === 4) {\n this.formValues.push(rowValue);\n }\n });\n\n if (this.formValues.length === this.rowData.length) {\n const valueJsonString = JSON.stringify(this.formValues);\n this.allFormValues.emit(valueJsonString);\n } else {\n this.allFormValues.emit('');\n }\n }\n\n render() {\n return (\n <Host class=\"dropdown-with-multi-input-elemet\">\n <div class=\"dropdown-with-multi-input-elemet__row\">\n <div>\n <pn-select ref={el => (this.pnFirstDropdown = el as HTMLElement)} class=\"pn-row-select-dropdown dropDown1-dropdown\" label={this.firstDropdownLabel} empty-option=\"true\" language={this.languageCode}>\n {this.dropdownDataRoot?.map((item, i) => (\n <pn-option index={i} label={item.value} value={item.value} selected={item.checked} onClick={debounce(this.handleFirstDropdown.bind(this), 500)}></pn-option>\n ))}\n </pn-select>\n {this.firstDropdownHelperText?.length ? <small>{this.firstDropdownHelperText}</small> : null}\n </div>\n </div>\n\n <div class=\"dropdown-with-multi-input-elemet__row\">\n <div>\n <pn-select ref={el => (this.pnSecondDropdown = el as HTMLElement)} class=\"pn-row-select-dropdown dropDown2-dropdown\" label={this.secondDropdownLabel} empty-option=\"true\" language={this.languageCode}>\n {this.secondDropdownArr?.map((item, i) => (\n <pn-option index={i} label={item} value={item} selected={item === this._secondDropdownSelection} onClick={debounce(this.handleSecondDropdown.bind(this), 500)}></pn-option>\n ))}\n </pn-select>\n {this.secondDropdownHelperText?.length ? <small>{this.secondDropdownHelperText}</small> : null}\n </div>\n </div>\n\n {this.showDelteConfirm ? (\n <div class=\"dropdown-with-multi-input-elemet__delete\">\n <p>{this.deleteMultipleRowsWarningText}</p>\n <pn-button ref={el => (this.pnConfirmDeleteButton = el as HTMLElement)} small=\"true\" appearance=\"warning\" onClick={this.deleteExcessRows.bind(this)}>\n {this.confirmDeleteButtonText}\n </pn-button>\n <pn-button ref={el => (this.pnAbortDeleteButton = el as HTMLElement)} small=\"true\" appearance=\"light\" onClick={this.abortDeleteRows.bind(this)}>\n {this.abortDeleteButtonText}\n </pn-button>\n </div>\n ) : null}\n\n <div class=\"dropdown-with-multi-input-elemet__label-row\">\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.fristInputLabel}</label>\n </div>\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.secondInputLabel}</label>\n </div>\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.dateLabel}</label>\n </div>\n </div>\n\n {this.rowData?.map((data, i) => {\n return (\n <div class={'dropdown-with-multi-input-elemet__row generated-row-' + i} id={'generated-row-' + i}>\n <pn-dropdown-with-multi-input-rows-row\n language-code={this.languageCode}\n frist-input-placeholder={this.fristInputPlaceholder}\n first-input-min={this.firstInputMin}\n first-input-max={this.firstInputMax}\n first-input-warning={this.firstInputWarning}\n first-input-warning-text={this.firstInputWarningText}\n first-input-low-error-text={this.firstInputLowErrorText}\n first-input-high-error-text={this.firstInputHighErrorText}\n second-input-placeholder={this.secondInputPlaceholder}\n second-input-min={this.secondInputMin}\n second-input-max={this.secondInputMax}\n second-input-warning={this.secondInputWarning}\n second-input-warning-text={this.secondInputWarningText}\n second-input-low-error-text={this.secondInputLowErrorText}\n second-input-high-error-text={this.secondInputHighErrorText}\n datePlaceholder={this.datePlaceholder}\n firstValidDate={this.firstValidDateString}\n lastValidDate={this.lastValidDateString}\n predefined-value={JSON.stringify(data)}\n min-row-count={this.minRowCount}\n row-index={i}\n ></pn-dropdown-with-multi-input-rows-row>\n </div>\n );\n })}\n\n <div class=\"dropdown-with-multi-input-elemet__row sum-row\">\n <pn-marketweb-input disabled={true} ref={el => (this.pnSumField = el as HTMLElement)} type=\"number\" value={this.rowSum} label={this.sumFieldLabel}></pn-marketweb-input>\n\n <pn-button\n tooltip={this.addRowText ? this.addRowText : null}\n left-icon=\"true\"\n arialabel=\"Add\"\n icon={plus}\n appearance=\"light\"\n variant=\"borderless\"\n class=\"connected-dropdown__button-right\"\n onClick={() => {\n this.addRow(this.generateUniqueId());\n }}\n >\n {this.addRowText}\n </pn-button>\n </div>\n\n {this.elementHelperText?.length ? <div class=\"dropdown-with-multi-input-elemet__row\">{this.elementHelperText}</div> : null}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pn-dropdown-with-multi-input-rows.entry.cjs.js","mappings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AAC,iBAAiB,EAAE,MAAM,GAAGH,iBAAK,KAAK,EAAC,uCAAuC,IAAE,IAAI,CAAC,iBAAiB,CAAO,GAAG,IAAI,CACrH,EACP;KACH;;;;;;","names":["uuidv4","h","Host","debounce","plus"],"sources":["src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.scss?tag=pn-dropdown-with-multi-input-rows","src/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-dropdown-with-multi-input-rows {\n .dropdown-with-multi-input-elemet {\n &__row {\n margin-bottom: 1rem;\n }\n\n &__delete {\n display: flex;\n gap: 1rem;\n margin-bottom: 1rem;\n padding: 1rem;\n background-color: $gray25;\n\n pn-button {\n margin-top: 0.9rem;\n }\n }\n\n &__label-row {\n display: flex;\n gap: 1rem;\n }\n\n &__label {\n width: 30%;\n font-size: 0.875em;\n color: #5e554a;\n }\n }\n\n .sum-row {\n display: flex;\n justify-content: space-between;\n }\n}\n","import { Component, Prop, h, Element, State, Host, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { FormValue, RowValue, Root, PredefinedValues } from './types';\nimport { v4 as uuidv4 } from 'uuid';\nimport debounce from 'debounce';\nimport { plus } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-dropdown-with-multi-input-rows',\n styleUrl: 'pn-dropdown-with-multi-input-rows.scss',\n})\nexport class PnDropdownWithMultiInputRows {\n @Element() hostElement: Element;\n pnFirstDropdown: HTMLElement = null;\n pnSecondDropdown: HTMLElement = null;\n pnSumField: HTMLElement = null;\n pnConfirmDeleteButton: HTMLElement = null;\n pnAbortDeleteButton: HTMLElement = null;\n\n @Prop() dropdownData: string | Root[] = null;\n @Prop() languageCode: string = null;\n @Prop() firstDropdownLabel: string = null;\n @Prop() firstDropdownHelperText: string = null;\n @Prop() secondDropdownLabel: string = null;\n @Prop() secondDropdownHelperText: string = null;\n @Prop() secondDropdownMax: number = null;\n @Prop() deleteMultipleRowsWarningText: string = null;\n @Prop() confirmDeleteButtonText: string = null;\n @Prop() abortDeleteButtonText: string = null;\n @Prop() fristInputLabel: string = null;\n @Prop() fristInputPlaceholder: string = null;\n @Prop() firstInputMin: number = null;\n @Prop() firstInputMax: number = null;\n @Prop() firstInputWarning: number = null;\n @Prop() firstInputWarningText: string = null;\n @Prop() firstInputLowErrorText: string = null;\n @Prop() firstInputHighErrorText: string = null;\n @Prop() secondInputLabel: string = null;\n @Prop() secondInputPlaceholder: string = null;\n @Prop() secondInputMin: number = null;\n @Prop() secondInputMax: number = null;\n @Prop() secondInputWarning: number = null;\n @Prop() secondInputWarningText: string = null;\n @Prop() secondInputLowErrorText: string = null;\n @Prop() secondInputHighErrorText: string = null;\n @Prop() dateLabel: string = null;\n @Prop() datePlaceholder: string = null;\n @Prop() dateDaysFromToday: number = 1;\n @Prop() yearsToAddToEndDate: number = null;\n @Prop() sumFieldLabel: string = null;\n @Prop() addRowText: string = null;\n @Prop() elementHelperText: string = null;\n\n @State() dropdownDataRoot: Root[] = null;\n @State() secondDropdownArr: number[] = [];\n @State() rowCount: number = null;\n @State() rowData: PredefinedValues[] = null;\n @State() formValues: FormValue[] = null;\n @State() firstValidDateString: string = '';\n @State() lastValidDateString: string = '';\n @State() rowSum: string = null;\n @State() minRowCount: number = null;\n @State() showDelteConfirm: boolean = false;\n\n @Event() allFormValues: EventEmitter<string>;\n\n private _firstDropdownSelection: string = null;\n private _secondDropdownSelection: number = null;\n\n private _defaultRow: PredefinedValues;\n\n constructor() {\n this._defaultRow = {\n id: this.generateUniqueId(),\n firstInput: '',\n secondInput: this.secondInputWarning !== null ? this.secondInputWarning.toString() : '',\n date: '',\n };\n }\n\n componentWillLoad() {\n this.formValues = [];\n this.setDropDownData();\n this.updateSecondDropdown();\n this.setRowData();\n this.setFirstValidDate();\n }\n\n componentDidLoad() {\n this.updateSum();\n }\n\n setDropDownData() {\n if (typeof this.dropdownData === 'string') {\n this.dropdownDataRoot = JSON.parse(this.dropdownData);\n } else {\n this.dropdownDataRoot = this.dropdownData;\n }\n\n if (this.dropdownDataRoot?.length) {\n this.dropdownDataRoot.forEach(element => {\n if (!element.value) {\n element.value = 0;\n }\n });\n }\n\n if (this.dropdownDataRoot.length > 0) {\n this.dropdownDataRoot[0].checked = true;\n this._firstDropdownSelection = this.dropdownDataRoot[0].label;\n this._secondDropdownSelection = this.dropdownDataRoot[0].value;\n this.minRowCount = this.dropdownDataRoot[0].value;\n }\n }\n\n updateSecondDropdown() {\n const selectedItem = this.dropdownDataRoot.find(arr => arr.checked === true);\n this.secondDropdownArr = [];\n\n for (let index = selectedItem.value; index <= this.secondDropdownMax; index++) {\n this.secondDropdownArr.push(index);\n }\n }\n\n updateSelectItemArr(arr: Root[], caption: string) {\n arr.forEach(item => {\n if (item.label === caption) {\n item.checked = !item.checked;\n } else {\n item.checked = false;\n }\n });\n return arr;\n }\n\n setRowData() {\n this.rowData = [];\n for (let index = 0; index < this._secondDropdownSelection; index++) {\n const row = Object.assign({}, this._defaultRow);\n row.id = this.generateUniqueId();\n this.rowData = [...this.rowData, row];\n }\n\n this.rowCount = this.rowData.length;\n }\n\n generateUniqueId() {\n return uuidv4();\n }\n\n setFirstValidDate() {\n const yearsToadd = this.yearsToAddToEndDate ? this.yearsToAddToEndDate : 2;\n const date = new Date();\n date.setDate(date.getDate() + this.dateDaysFromToday ?? 0);\n\n const year = date.getFullYear();\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const day = date.getDate().toString().padStart(2, '0');\n const endYear = year + yearsToadd;\n\n this.firstValidDateString = `${year.toString()}-${month}-${day}`;\n this.lastValidDateString = `${endYear.toString()}-${month}-${day}`;\n }\n\n addRow(newRowId: string) {\n const newRow = Object.assign({}, this.rowData[0]);\n newRow.id = newRowId ? newRowId : this.generateUniqueId();\n newRow.date = '';\n this.rowData = [...this.rowData, newRow];\n this.rowCount = this.rowData.length;\n\n this._secondDropdownSelection = this.rowCount;\n this.secondDropdownArr = [...this.secondDropdownArr];\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n handleFirstDropdown() {\n const selected = this.pnFirstDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n\n this.dropdownDataRoot.forEach(element => {\n element.checked = false;\n });\n const selectionRoot = this.dropdownDataRoot.find(x => x.value?.toString() === selectedValue);\n selectionRoot.checked = true;\n this._firstDropdownSelection = selectionRoot.label;\n this.minRowCount = selectionRoot.value;\n\n if (selectionRoot.value > this._secondDropdownSelection) {\n this.dropdownDataRoot = [...this.dropdownDataRoot];\n\n for (let index = this.rowCount; index < selectionRoot.value; index++) {\n this.addRow(this.generateUniqueId());\n }\n }\n\n this.updateSecondDropdown();\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n handleSecondDropdown() {\n const selected = this.pnSecondDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n\n const value = parseInt(selectedValue);\n if (value < this._secondDropdownSelection) {\n this.showDelteConfirm = true;\n } else {\n for (let index = this.rowCount; index < value; index++) {\n this.addRow(this.generateUniqueId());\n }\n }\n this.updateSum();\n this.emitValuesIfValid();\n }\n\n @Listen('rowValueChange')\n @Listen('firstInputChange')\n @Listen('secondInputChange')\n predefinedValueChange(e) {\n const indexToUpdate = this.rowData.findIndex(data => data.id === e.detail.id);\n const val: PredefinedValues = e.detail;\n this.rowData[indexToUpdate] = {\n ...this.rowData[indexToUpdate],\n firstInput: val.firstInput,\n secondInput: val.secondInput,\n date: val.date,\n };\n\n if (e.type === 'firstInputChange' && indexToUpdate === 0) {\n this.updateFirstInputOfRows(val.firstInput);\n }\n\n if (e.type === 'secondInputChange' && indexToUpdate === 0) {\n this.updateSecondInputOfRows(val.secondInput);\n }\n\n this.rowData = [...this.rowData];\n this.emitValuesIfValid();\n this.updateSum();\n }\n\n updateFirstInputOfRows(value: string) {\n for (let index = 1; index < this.rowCount; index++) {\n this.rowData[index] = {\n ...this.rowData[index],\n firstInput: value,\n };\n }\n }\n\n updateSecondInputOfRows(value: string) {\n for (let index = 1; index < this.rowCount; index++) {\n this.rowData[index] = {\n ...this.rowData[index],\n secondInput: value,\n };\n }\n }\n\n @Listen('deleteRowEvent')\n deleteRowEvent(e) {\n const indexToRemove = this.rowData.findIndex(data => data.id === e.detail);\n if (indexToRemove < 0) {\n return;\n }\n\n this.rowData.splice(indexToRemove, 1);\n this.rowData = [...this.rowData];\n this.rowCount = this.rowData.length;\n\n this._secondDropdownSelection = this.rowCount;\n this.secondDropdownArr = [...this.secondDropdownArr];\n this.emitValuesIfValid();\n this.updateSum();\n }\n\n updateSum() {\n this.rowSum = '';\n let sum = 0;\n this.rowData.forEach(element => {\n if (element?.firstInput?.length) {\n sum += parseInt(element.firstInput);\n }\n });\n\n this.rowSum = sum.toString();\n }\n\n deleteExcessRows() {\n const selected = this.pnSecondDropdown.querySelector('[aria-selected=true]');\n const selectedValue = selected?.textContent;\n if (!selectedValue?.length) {\n return;\n }\n const rowsToDelete = this.rowCount - parseInt(selectedValue);\n for (let index = 0; index < rowsToDelete; index++) {\n this.rowData.pop();\n }\n this.rowData = [...this.rowData];\n this.showDelteConfirm = false;\n this.updateSum();\n }\n\n abortDeleteRows() {\n this.showDelteConfirm = false;\n }\n\n emitValuesIfValid() {\n this.formValues = [];\n this.rowData.forEach(item => {\n const rowValue: FormValue = { row: [] };\n if (this._firstDropdownSelection?.length) {\n const dropDownValue: RowValue = { name: this.firstDropdownLabel, value: this._firstDropdownSelection };\n rowValue.row.push(dropDownValue);\n }\n \n if (item.firstInput?.length) {\n const firstInputValue: RowValue = { name: this.fristInputLabel, value: item.firstInput };\n rowValue.row.push(firstInputValue);\n }\n \n if (item.secondInput?.length) {\n const secondInputValue: RowValue = { name: this.secondInputLabel, value: item.secondInput };\n rowValue.row.push(secondInputValue);\n }\n\n if (item.date) {\n const dateValue: RowValue = { name: this.dateLabel, value: item.date };\n rowValue.row.push(dateValue);\n }\n \n if (rowValue.row.length === 4) {\n this.formValues.push(rowValue);\n }\n });\n \n if (this.formValues.length === this.rowData.length) {\n const valueJsonString = JSON.stringify(this.formValues);\n this.allFormValues.emit(valueJsonString);\n } else {\n this.allFormValues.emit('');\n }\n }\n\n render() {\n return (\n <Host class=\"dropdown-with-multi-input-elemet\">\n <div class=\"dropdown-with-multi-input-elemet__row\">\n <div>\n <pn-select ref={el => (this.pnFirstDropdown = el as HTMLElement)} class=\"pn-row-select-dropdown dropDown1-dropdown\" label={this.firstDropdownLabel} empty-option=\"true\" language={this.languageCode}>\n {this.dropdownDataRoot?.map((item, i) => (\n <pn-option index={i} label={item.value} value={item.value} selected={item.checked} onClick={debounce(this.handleFirstDropdown.bind(this), 500)}></pn-option>\n ))}\n </pn-select>\n {this.firstDropdownHelperText?.length ? <small>{this.firstDropdownHelperText}</small> : null}\n </div>\n </div>\n\n <div class=\"dropdown-with-multi-input-elemet__row\">\n <div>\n <pn-select ref={el => (this.pnSecondDropdown = el as HTMLElement)} class=\"pn-row-select-dropdown dropDown2-dropdown\" label={this.secondDropdownLabel} empty-option=\"true\" language={this.languageCode}>\n {this.secondDropdownArr?.map((item, i) => (\n <pn-option index={i} label={item} value={item} selected={item === this._secondDropdownSelection} onClick={debounce(this.handleSecondDropdown.bind(this), 500)}></pn-option>\n ))}\n </pn-select>\n {this.secondDropdownHelperText?.length ? <small>{this.secondDropdownHelperText}</small> : null}\n </div>\n </div>\n\n {this.showDelteConfirm ? (\n <div class=\"dropdown-with-multi-input-elemet__delete\">\n <p>{this.deleteMultipleRowsWarningText}</p>\n <pn-button ref={el => (this.pnConfirmDeleteButton = el as HTMLElement)} small=\"true\" appearance=\"warning\" onClick={this.deleteExcessRows.bind(this)}>\n {this.confirmDeleteButtonText}\n </pn-button>\n <pn-button ref={el => (this.pnAbortDeleteButton = el as HTMLElement)} small=\"true\" appearance=\"light\" onClick={this.abortDeleteRows.bind(this)}>\n {this.abortDeleteButtonText}\n </pn-button>\n </div>\n ) : null}\n\n <div class=\"dropdown-with-multi-input-elemet__label-row\">\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.fristInputLabel}</label>\n </div>\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.secondInputLabel}</label>\n </div>\n <div class=\"dropdown-with-multi-input-elemet__label\">\n <label>{this.dateLabel}</label>\n </div>\n </div>\n\n {this.rowData?.map((data, i) => {\n return (\n <div class={'dropdown-with-multi-input-elemet__row generated-row-' + i} id={'generated-row-' + i}>\n <pn-dropdown-with-multi-input-rows-row\n language-code={this.languageCode}\n frist-input-placeholder={this.fristInputPlaceholder}\n first-input-min={this.firstInputMin}\n first-input-max={this.firstInputMax}\n first-input-warning={this.firstInputWarning}\n first-input-warning-text={this.firstInputWarningText}\n first-input-low-error-text={this.firstInputLowErrorText}\n first-input-high-error-text={this.firstInputHighErrorText}\n second-input-placeholder={this.secondInputPlaceholder}\n second-input-min={this.secondInputMin}\n second-input-max={this.secondInputMax}\n second-input-warning={this.secondInputWarning}\n second-input-warning-text={this.secondInputWarningText}\n second-input-low-error-text={this.secondInputLowErrorText}\n second-input-high-error-text={this.secondInputHighErrorText}\n datePlaceholder={this.datePlaceholder}\n firstValidDate={this.firstValidDateString}\n lastValidDate={this.lastValidDateString}\n predefined-value={JSON.stringify(data)}\n min-row-count={this.minRowCount}\n row-index={i}\n ></pn-dropdown-with-multi-input-rows-row>\n </div>\n );\n })}\n\n <div class=\"dropdown-with-multi-input-elemet__row sum-row\">\n <pn-marketweb-input disabled={true} ref={el => (this.pnSumField = el as HTMLElement)} type=\"number\" value={this.rowSum} label={this.sumFieldLabel}></pn-marketweb-input>\n\n <pn-button\n tooltip={this.addRowText ? this.addRowText : null}\n left-icon=\"true\"\n arialabel=\"Add\"\n icon={plus}\n appearance=\"light\"\n variant=\"borderless\"\n class=\"connected-dropdown__button-right\"\n onClick={() => {\n this.addRow(this.generateUniqueId());\n }}\n >\n {this.addRowText}\n </pn-button>\n </div>\n\n {this.elementHelperText?.length ? <div class=\"dropdown-with-multi-input-elemet__row\">{this.elementHelperText}</div> : null}\n </Host>\n );\n }\n}\n"],"version":3}