golden-logic-ui 1.2.45 → 1.2.46

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.
@@ -91259,6 +91259,7 @@ const $Ae = {
91259
91259
  search: "",
91260
91260
  isDropdownOpen: !1,
91261
91261
  itemLists: [],
91262
+ cloumnsHidden: [],
91262
91263
  tableData: [],
91263
91264
  sortField: this.xprops.defaultSortField ? this.xprops.defaultSortField : this.columns && this.columns.length > 0 ? this.columns[0].field_name : "",
91264
91265
  sortOrder: "desc",
@@ -91280,6 +91281,11 @@ const $Ae = {
91280
91281
  },
91281
91282
  customFilters() {
91282
91283
  return this.xprops.customFilters;
91284
+ },
91285
+ visibleColumns() {
91286
+ return this.columns.filter(
91287
+ (r) => !this.columnsHidden.includes(r.field_name)
91288
+ );
91283
91289
  }
91284
91290
  },
91285
91291
  methods: {
@@ -91370,10 +91376,19 @@ const $Ae = {
91370
91376
  exportToExcel() {
91371
91377
  const r = document.querySelector("#table" + this.Random_string), t = Array.from(r.querySelectorAll("thead th")).map((R) => R.innerText), l = ["", ...["Action"]], c = t.map((R, M) => l.includes(R) ? M : -1).filter((R) => R !== -1), f = Array.from(r.querySelectorAll("tbody tr")).map((R) => Array.from(R.querySelectorAll("td")).map((V) => V.innerText).filter((V, G) => !c.includes(G))), b = [t.filter((R, M) => !c.includes(M)), ...f], x = pte.aoa_to_sheet(b), C = pte.book_new();
91372
91378
  pte.book_append_sheet(C, x, "Sheet1"), vAe(C, "exported-file.xlsx");
91379
+ },
91380
+ handleBeforePrint() {
91381
+ console.log("User is about to print!"), this.cloumnsHidden = ["Action"];
91382
+ },
91383
+ handleAfterPrint() {
91384
+ console.log("User finished printing!"), this.cloumnsHidden = [];
91373
91385
  }
91374
91386
  },
91375
91387
  mounted() {
91376
- this.GetItemLists(), this.isMounted = !0;
91388
+ this.GetItemLists(), this.isMounted = !0, window.addEventListener("beforeprint", this.handleBeforePrint), window.addEventListener("afterprint", this.handleAfterPrint);
91389
+ },
91390
+ beforeDestroy() {
91391
+ window.removeEventListener("beforeprint", this.handleBeforePrint), window.removeEventListener("afterprint", this.handleAfterPrint);
91377
91392
  },
91378
91393
  watch: {
91379
91394
  searchFilter() {
@@ -91625,7 +91640,7 @@ function t5e(r, t, s, l, c, f) {
91625
91640
  W("thead", zAe, [
91626
91641
  W("tr", null, [
91627
91642
  s.enable_select_deselect_delete ? (Ve(), Ye("th", ZAe)) : Lt("", !0),
91628
- (Ve(!0), Ye(lo, null, si(s.columns, (ue, ne) => (Ve(), Ye("th", {
91643
+ (Ve(!0), Ye(lo, null, si(f.visibleColumns, (ue, ne) => (Ve(), Ye("th", {
91629
91644
  key: ne,
91630
91645
  onClick: (_e) => f.updateSortColumn(ue.field_name, ue.sortable),
91631
91646
  class: Nn(["w-full px-4 py-2 lg:w-2/12 print:w-2/12! print:border-[1px]!", {
@@ -91700,7 +91715,7 @@ function t5e(r, t, s, l, c, f) {
91700
91715
  class: "w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded-sm focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
91701
91716
  }, null, 40, KAe)
91702
91717
  ])) : Lt("", !0),
91703
- (Ve(!0), Ye(lo, null, si(s.columns, (_e, yt) => (Ve(), Ye("td", {
91718
+ (Ve(!0), Ye(lo, null, si(f.visibleColumns, (_e, yt) => (Ve(), Ye("td", {
91704
91719
  style: mz(_e == null ? void 0 : _e.style),
91705
91720
  key: yt,
91706
91721
  "data-label": _e.field_label,
@@ -91746,7 +91761,7 @@ function t5e(r, t, s, l, c, f) {
91746
91761
  ])
91747
91762
  ], 64);
91748
91763
  }
91749
- const XRe = /* @__PURE__ */ Ii($Ae, [["render", t5e], ["__scopeId", "data-v-b78839a9"]]), n5e = {
91764
+ const XRe = /* @__PURE__ */ Ii($Ae, [["render", t5e], ["__scopeId", "data-v-0cee35b0"]]), n5e = {
91750
91765
  components: {},
91751
91766
  props: {
91752
91767
  data: Array,