golden-logic-ui 1.0.496 → 1.0.498

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.
@@ -1815,6 +1815,7 @@ const Hce = /* @__PURE__ */ zr(wX, [["render", CX]]), _X = {
1815
1815
  },
1816
1816
  data() {
1817
1817
  return {
1818
+ mutationObserver: null,
1818
1819
  elementsToShow: this.elements_to_show_prop,
1819
1820
  dotsNum: 0,
1820
1821
  currentDot: 1,
@@ -1828,13 +1829,27 @@ const Hce = /* @__PURE__ */ zr(wX, [["render", CX]]), _X = {
1828
1829
  },
1829
1830
  mounted() {
1830
1831
  this.$nextTick(() => {
1831
- this.initSlider(), this.disable_touch || this.movingActions(), window.addEventListener("resize", this.resizeHandler);
1832
+ this.observeSlotChanges(), this.initSlider(), this.disable_touch || this.movingActions(), window.addEventListener("resize", this.resizeHandler);
1832
1833
  });
1833
1834
  },
1834
1835
  beforeDestroy() {
1835
1836
  window.removeEventListener("resize", this.resizeHandler);
1836
1837
  },
1838
+ beforeUnmount() {
1839
+ this.mutationObserver && this.mutationObserver.disconnect();
1840
+ },
1837
1841
  methods: {
1842
+ observeSlotChanges() {
1843
+ const A = this.$refs.slotContainer;
1844
+ A && (this.mutationObserver = new MutationObserver((te) => {
1845
+ te.forEach((G) => {
1846
+ this.initSlider();
1847
+ });
1848
+ }), this.mutationObserver.observe(A, {
1849
+ childList: !0,
1850
+ subtree: !0
1851
+ }));
1852
+ },
1838
1853
  resizeHandler() {
1839
1854
  this.initSlider();
1840
1855
  },
@@ -1863,7 +1878,7 @@ const Hce = /* @__PURE__ */ zr(wX, [["render", CX]]), _X = {
1863
1878
  },
1864
1879
  initSlider() {
1865
1880
  let A = document.getElementById("sliderContainer_" + this.Random_string), te = document.getElementById("mainSliderContainer_" + this.Random_string), G = document.getElementById("slider_" + this.Random_string), Ce = Array.from(G.querySelectorAll("li")).filter((be) => be.parentNode === G), oe = A.clientWidth, U = oe / this.elementsToShow;
1866
- if (this.elementsToShow > 1 ? document.body.clientWidth < 1e3 ? (this.elementsToShow = 1, U = this.hide_arrow ? te.clientWidth : oe) : document.body.clientWidth < 1500 && (this.elementsToShow = 2) : (this.elementsToShow = 1, U = te.clientWidth), Ce.length > 1) {
1881
+ if (this.elementsToShow > 1 ? document.body.clientWidth < 1e3 ? (this.elementsToShow = 1, U = this.hide_arrow ? te.clientWidth : oe) : document.body.clientWidth < 1500 && (this.elementsToShow = 2) : (this.elementsToShow = 1, U = te.clientWidth, console.log("cardwidth: ", U)), Ce.length > 1) {
1867
1882
  this.dotsNum = this.elementsToShow === 1 ? Ce.length : Ce.length - this.elementsToShow + 1;
1868
1883
  let be = this.elementsToShow === 1 ? U * Ce.length / this.dotsNum : U * (Ce.length - this.elementsToShow) / (this.dotsNum - 1);
1869
1884
  this.dotsNavigation = Array.from({ length: this.dotsNum }, (q, De) => be * De);
@@ -1875,7 +1890,7 @@ const Hce = /* @__PURE__ */ zr(wX, [["render", CX]]), _X = {
1875
1890
  this.direction_property === "rtl" ? te.style.marginRight = -this.dotsNavigation[A - 1] + "px" : te.style.marginLeft = -this.dotsNavigation[A - 1] + "px", this.currentDot = A;
1876
1891
  }
1877
1892
  }
1878
- }, Sm = (A) => (rq("data-v-6f79f1dd"), A = A(), aq(), A), SX = ["id"], kX = {
1893
+ }, Sm = (A) => (rq("data-v-6f277a64"), A = A(), aq(), A), SX = ["id"], kX = {
1879
1894
  key: 0,
1880
1895
  class: "items-center hidden w-2/12 xl:flex xxl:flex md:flex sm:flex arrow_button"
1881
1896
  }, TX = { class: "w-full" }, EX = {
@@ -2078,6 +2093,7 @@ function EJ(A, te, G, Ce, oe, U) {
2078
2093
  ])
2079
2094
  ])) : qe("", !0),
2080
2095
  R("div", {
2096
+ ref: "slotContainer",
2081
2097
  class: zt(["overflow-hidden flex flex-col gap-3", U.sliderContainerAction()]),
2082
2098
  id: "sliderContainer_" + oe.Random_string
2083
2099
  }, [
@@ -2177,7 +2193,7 @@ function EJ(A, te, G, Ce, oe, U) {
2177
2193
  ], 10, SX)
2178
2194
  ]);
2179
2195
  }
2180
- const Vce = /* @__PURE__ */ zr(_X, [["render", EJ], ["__scopeId", "data-v-6f79f1dd"]]), AJ = {
2196
+ const Vce = /* @__PURE__ */ zr(_X, [["render", EJ], ["__scopeId", "data-v-6f277a64"]]), AJ = {
2181
2197
  props: {
2182
2198
  elements_to_show_prop: {
2183
2199
  type: Number,