@salla.sa/twilight-components 2.11.25 → 2.11.27

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 (52) hide show
  1. package/dist/cjs/camera-058ddeeb.js +13 -0
  2. package/dist/cjs/index-1d2b3370.js +10 -2
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{salla-button_37.cjs.entry.js → salla-button_36.cjs.entry.js} +66 -348
  5. package/dist/cjs/salla-conditional-fields.cjs.entry.js +99 -0
  6. package/dist/cjs/salla-product-options.cjs.entry.js +257 -0
  7. package/dist/cjs/twilight.cjs.js +1 -1
  8. package/dist/collection/collection-manifest.json +1 -0
  9. package/dist/collection/components/salla-product-options/salla-product-options.js +11 -4
  10. package/dist/collection/components/salla-progress-bar/salla-progress-bar.css +34 -0
  11. package/dist/collection/components/salla-progress-bar/salla-progress-bar.js +196 -0
  12. package/dist/collection/components/salla-slider/salla-slider.js +13 -10
  13. package/dist/collection/global/app-dev.js +5 -0
  14. package/dist/components/index.d.ts +1 -0
  15. package/dist/components/index.js +1 -0
  16. package/dist/components/salla-product-options.js +32 -21
  17. package/dist/components/salla-progress-bar.d.ts +11 -0
  18. package/dist/components/salla-progress-bar.js +9 -0
  19. package/dist/components/salla-progress-bar2.js +81 -0
  20. package/dist/components/salla-slider2.js +11 -8
  21. package/dist/esm/camera-647ab50f.js +11 -0
  22. package/dist/esm/index-f1d446ac.js +10 -2
  23. package/dist/esm/loader.js +1 -1
  24. package/dist/esm/{salla-button_37.entry.js → salla-button_36.entry.js} +65 -346
  25. package/dist/esm/salla-conditional-fields.entry.js +95 -0
  26. package/dist/esm/salla-product-options.entry.js +253 -0
  27. package/dist/esm/twilight.js +1 -1
  28. package/dist/esm-es5/camera-647ab50f.js +4 -0
  29. package/dist/esm-es5/index-f1d446ac.js +1 -1
  30. package/dist/esm-es5/loader.js +1 -1
  31. package/dist/esm-es5/salla-button_36.entry.js +53 -0
  32. package/dist/esm-es5/salla-conditional-fields.entry.js +4 -0
  33. package/dist/esm-es5/salla-product-options.entry.js +4 -0
  34. package/dist/esm-es5/twilight.js +1 -1
  35. package/dist/twilight/p-1b87ab66.system.js +1 -1
  36. package/dist/twilight/p-485b62a3.entry.js +36 -0
  37. package/dist/twilight/p-56830c52.system.entry.js +4 -0
  38. package/dist/twilight/p-643ea74e.entry.js +4 -0
  39. package/dist/twilight/p-79264f27.system.entry.js +53 -0
  40. package/dist/twilight/p-9b7452c1.entry.js +4 -0
  41. package/dist/twilight/p-c328c14e.system.js +4 -0
  42. package/dist/twilight/p-ccd78636.js +4 -0
  43. package/dist/twilight/p-dbe8db94.system.entry.js +4 -0
  44. package/dist/twilight/twilight.esm.js +1 -1
  45. package/dist/types/components/salla-product-options/interfaces.d.ts +9 -0
  46. package/dist/types/components/salla-progress-bar/salla-progress-bar.d.ts +35 -0
  47. package/dist/types/components/salla-slider/salla-slider.d.ts +1 -1
  48. package/dist/types/components.d.ts +72 -2
  49. package/package.json +4 -4
  50. package/dist/esm-es5/salla-button_37.entry.js +0 -53
  51. package/dist/twilight/p-11da4b05.entry.js +0 -36
  52. package/dist/twilight/p-cd5fda9d.system.entry.js +0 -53
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ System.register(["./p-d9130020.system.js"],(function(e){"use strict";var t,n,o,a;return{setters:[function(e){t=e.r;n=e.h;o=e.H;a=e.g}],execute:function(){var i=e("salla_conditional_fields",function(){function e(e){t(this,e)}e.prototype.hideAllOptions=function(e){var t=this;this.host.querySelectorAll('[data-show-when^="options['.concat(e,'"]')).forEach((function(e){e.classList.add("hidden");t.hideAllOptions(e.dataset.optionId);t.disableInputs(e)}))};e.prototype.disableInputs=function(e){e.querySelectorAll("[name]").forEach((function(e){var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))};e.prototype.changeHandler=function(e){var t=this;var n;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not support input: "+(((n=e===null||e===void 0?void 0:e.target)===null||n===void 0?void 0:n.tagName)||"N/A"));return}var o=e.target.name.replace("[]","");var a=e.target.getAttribute("type")==="checkbox";salla.log("Trying to find all the element with condition:",'[data-show-when^="'.concat(o,'"]'));this.host.querySelectorAll('[data-show-when^="'.concat(o,'"]')).forEach((function(n){var o=!(n===null||n===void 0?void 0:n.dataset.showWhen.includes("!="));var i=n===null||n===void 0?void 0:n.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();var r;if(a){var l=Array.from(t.host.querySelectorAll('input[name="'.concat(e.target.name,'"]:checked')),(function(e){return e===null||e===void 0?void 0:e.value}));r=l.includes(i.toString())}else{r=i===e.target.value}salla.log("The input is ",a?"Multiple":"Single"," value:",r);var s=o&&r||!o&&!r;if(s){n.classList.remove("hidden");n.querySelectorAll("[name]").forEach((function(e){e.removeAttribute("disabled");if(!["checkbox"].includes(e.getAttribute("type"))&&n.getElementsByClassName("required").length){e.setAttribute("required","")}}))}else{t.hideAllOptions(n.dataset.optionId);n.classList.add("hidden");t.disableInputs(n)}}))};e.prototype.componentDidRender=function(){var e=this;this.host.querySelectorAll("[data-show-when]").forEach((function(t){var n;var o=(n=t===null||t===void 0?void 0:t.dataset)===null||n===void 0?void 0:n.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!o){return}e.changeHandler({target:e.host.querySelector('[name^="'+o+'"]')})}))};e.prototype.render=function(){return n(o,null,n("slot",null))};Object.defineProperty(e.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return e}())}}}));
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as e,h as i,H as l,g as t}from"./p-7dc66c07.js";const n=class{constructor(i){e(this,i)}hideAllOptions(e){this.host.querySelectorAll(`[data-show-when^="options[${e}"]`).forEach((e=>{e.classList.add("hidden"),this.hideAllOptions(e.dataset.optionId),this.disableInputs(e)}))}disableInputs(e){e.querySelectorAll("[name]").forEach((e=>{var i;e.setAttribute("disabled",""),e.removeAttribute("required"),"select"===(null===(i=null==e?void 0:e.tagName)||void 0===i?void 0:i.toLowerCase())&&(e.value=""),["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")&&(e.checked=!1)}))}changeHandler(e){var i;if(salla.event.emit("salla-onditional-fields::change",e),salla.log("Received the change event: ",e),!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type")))return void salla.log("Ignore the change because is not support input: "+((null===(i=null==e?void 0:e.target)||void 0===i?void 0:i.tagName)||"N/A"));let l=e.target.name.replace("[]",""),t="checkbox"===e.target.getAttribute("type");salla.log("Trying to find all the element with condition:",`[data-show-when^="${l}"]`),this.host.querySelectorAll(`[data-show-when^="${l}"]`).forEach((i=>{let l,n=!(null==i?void 0:i.dataset.showWhen.includes("!=")),a=null==i?void 0:i.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();l=t?Array.from(this.host.querySelectorAll(`input[name="${e.target.name}"]:checked`),(e=>null==e?void 0:e.value)).includes(a.toString()):a===e.target.value,salla.log("The input is ",t?"Multiple":"Single"," value:",l),n&&l||!n&&!l?(i.classList.remove("hidden"),i.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled"),!["checkbox"].includes(e.getAttribute("type"))&&i.getElementsByClassName("required").length&&e.setAttribute("required","")}))):(this.hideAllOptions(i.dataset.optionId),i.classList.add("hidden"),this.disableInputs(i))}))}componentDidRender(){this.host.querySelectorAll("[data-show-when]").forEach((e=>{var i;let l=null===(i=null==e?void 0:e.dataset)||void 0===i?void 0:i.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();l&&this.changeHandler({target:this.host.querySelector('[name^="'+l+'"]')})}))}render(){return i(l,null,i("slot",null))}get host(){return t(this)}};export{n as salla_conditional_fields}