@amirjalili1374/ui-kit 1.7.0 → 1.7.2
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.
- package/dist/components/shared/CustomDataTable.vue.d.ts.map +1 -1
- package/dist/components/shared/data-table-v2/CustomDataTableV2.vue.d.ts.map +1 -1
- package/dist/ui-kit.cjs.js +1 -1
- package/dist/ui-kit.cjs.js.map +1 -1
- package/dist/ui-kit.es.js +17 -15
- package/dist/ui-kit.es.js.map +1 -1
- package/package.json +4 -4
package/dist/ui-kit.es.js
CHANGED
|
@@ -3,7 +3,6 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { warn, reactive, watchEffect, toRef, capitalize, shallowRef, Fragment, camelize, isVNode, Comment, unref, getCurrentInstance as getCurrentInstance$1, ref, computed, provide, inject, defineComponent as defineComponent$1, h, createElementVNode, normalizeStyle, normalizeClass, toValue, resolveDynamicComponent, nextTick, onScopeDispose, createVNode, mergeProps, toRefs, Text, isRef, TransitionGroup, Transition, watch, onBeforeMount, onBeforeUnmount, withDirectives, vShow, toDisplayString, effectScope, toRaw, readonly, openBlock, createBlock, withCtx, createCommentVNode, useId, onMounted, onUpdated, Teleport, createTextVNode, createElementBlock, renderSlot, onDeactivated, cloneVNode, renderList, createSlots, normalizeProps, guardReactiveProps, resolveComponent, onActivated, onBeforeUpdate, withModifiers, vModelText, withKeys, useModel, mergeModels, onUnmounted } from "vue";
|
|
5
5
|
import { IconHome, IconArrowBadgeLeft, IconCheck, IconSquareX, IconChevronDown, IconChevronRight, IconCopy, IconX, IconMinus, IconPlus, IconRefresh, IconChevronLeft, IconDownload, IconPrinter, IconMaximize, IconMinimize, IconFileText, IconPencil, IconClock, IconMenu2, IconPalette } from "@tabler/icons-vue";
|
|
6
|
-
import * as XLSX from "xlsx-js-style";
|
|
7
6
|
import axios from "axios";
|
|
8
7
|
import { useDebounceFn } from "@vueuse/core";
|
|
9
8
|
import { useRouter as useRouter$1 } from "vue-router";
|
|
@@ -11,7 +10,6 @@ import { Vue3Lottie } from "vue3-lottie";
|
|
|
11
10
|
import { defineStore } from "pinia";
|
|
12
11
|
import { PerfectScrollbar } from "vue3-perfect-scrollbar";
|
|
13
12
|
import VueKeycloakJs from "@dsb-norge/vue-keycloak-js";
|
|
14
|
-
import * as XLSX$1 from "xlsx";
|
|
15
13
|
function propsFactory(props, source) {
|
|
16
14
|
return (defaults) => {
|
|
17
15
|
return Object.keys(props).reduce((obj, prop) => {
|
|
@@ -18835,9 +18833,11 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
|
|
|
18835
18833
|
const byteArray = new Uint8Array(byteNumbers);
|
|
18836
18834
|
return new Blob([byteArray], { type: mimeType });
|
|
18837
18835
|
};
|
|
18838
|
-
const handleExportClientSide = () => {
|
|
18836
|
+
const handleExportClientSide = async () => {
|
|
18839
18837
|
const sourceItems = (props.items && props.items.length ? props.items : items.value) ?? [];
|
|
18840
18838
|
if (!sourceItems.length) return;
|
|
18839
|
+
const XLSXmod = await import("xlsx-js-style");
|
|
18840
|
+
const XLSX = XLSXmod.default ?? XLSXmod;
|
|
18841
18841
|
const headers = props.headers.filter((h2) => h2.key && h2.title);
|
|
18842
18842
|
const now = /* @__PURE__ */ new Date();
|
|
18843
18843
|
const exportDate = now.toLocaleDateString("fa-IR") + " " + now.toLocaleTimeString("fa-IR", { hour: "2-digit", minute: "2-digit" });
|
|
@@ -19003,7 +19003,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
|
|
|
19003
19003
|
} else {
|
|
19004
19004
|
exportLoading.value = true;
|
|
19005
19005
|
try {
|
|
19006
|
-
handleExportClientSide();
|
|
19006
|
+
await handleExportClientSide();
|
|
19007
19007
|
} finally {
|
|
19008
19008
|
exportLoading.value = false;
|
|
19009
19009
|
}
|
|
@@ -21842,9 +21842,11 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
|
|
|
21842
21842
|
const byteArray = new Uint8Array(byteNumbers);
|
|
21843
21843
|
return new Blob([byteArray], { type: mimeType });
|
|
21844
21844
|
};
|
|
21845
|
-
const handleExportClientSide = () => {
|
|
21845
|
+
const handleExportClientSide = async () => {
|
|
21846
21846
|
const sourceItems = (props.items && props.items.length ? props.items : items.value) ?? [];
|
|
21847
21847
|
if (!sourceItems.length) return;
|
|
21848
|
+
const XLSXmod = await import("xlsx");
|
|
21849
|
+
const XLSX = XLSXmod.default ?? XLSXmod;
|
|
21848
21850
|
const headers = props.headers.filter((h2) => h2.key && h2.title);
|
|
21849
21851
|
const now = /* @__PURE__ */ new Date();
|
|
21850
21852
|
const exportDate = now.toLocaleDateString("fa-IR") + " " + now.toLocaleTimeString("fa-IR", { hour: "2-digit", minute: "2-digit" });
|
|
@@ -21872,11 +21874,11 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
|
|
|
21872
21874
|
else totalRow[h2.title] = "";
|
|
21873
21875
|
});
|
|
21874
21876
|
rows.push(totalRow);
|
|
21875
|
-
const ws = XLSX
|
|
21876
|
-
const range = XLSX
|
|
21877
|
+
const ws = XLSX.utils.json_to_sheet(rows, { origin: "A4" });
|
|
21878
|
+
const range = XLSX.utils.decode_range(ws["!ref"]);
|
|
21877
21879
|
ws["!freeze"] = { xSplit: 0, ySplit: 3 };
|
|
21878
21880
|
ws["!autofilter"] = {
|
|
21879
|
-
ref: XLSX
|
|
21881
|
+
ref: XLSX.utils.encode_range({
|
|
21880
21882
|
s: { r: 3, c: 0 },
|
|
21881
21883
|
e: range.e
|
|
21882
21884
|
})
|
|
@@ -21889,7 +21891,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
|
|
|
21889
21891
|
});
|
|
21890
21892
|
return { wch: max + 4 };
|
|
21891
21893
|
});
|
|
21892
|
-
XLSX
|
|
21894
|
+
XLSX.utils.sheet_add_aoa(ws, [[title], [`تاریخ چاپ: ${exportDate}`], []], { origin: "A1" });
|
|
21893
21895
|
ws["!merges"] = [
|
|
21894
21896
|
{
|
|
21895
21897
|
s: { r: 0, c: 0 },
|
|
@@ -21917,10 +21919,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
|
|
|
21917
21919
|
};
|
|
21918
21920
|
const zebraFill = { fgColor: { rgb: "F7F7F7" } };
|
|
21919
21921
|
headers.forEach((h2, c) => {
|
|
21920
|
-
const headerCell = XLSX
|
|
21922
|
+
const headerCell = XLSX.utils.encode_cell({ r: 3, c });
|
|
21921
21923
|
if (ws[headerCell]) ws[headerCell].s = headerStyle;
|
|
21922
21924
|
for (let r = 4; r <= rows.length + 3; r++) {
|
|
21923
|
-
const addr = XLSX
|
|
21925
|
+
const addr = XLSX.utils.encode_cell({ r, c });
|
|
21924
21926
|
const cell = ws[addr];
|
|
21925
21927
|
if (!cell) continue;
|
|
21926
21928
|
const isTotalRow = r === rows.length + 3;
|
|
@@ -21948,14 +21950,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
|
|
|
21948
21950
|
}
|
|
21949
21951
|
}
|
|
21950
21952
|
});
|
|
21951
|
-
const wb = XLSX
|
|
21953
|
+
const wb = XLSX.utils.book_new();
|
|
21952
21954
|
wb.Workbook = {
|
|
21953
21955
|
Views: [{ RTL: true }]
|
|
21954
21956
|
};
|
|
21955
|
-
XLSX
|
|
21957
|
+
XLSX.utils.book_append_sheet(wb, ws, "Report");
|
|
21956
21958
|
const dateForFile = now.toLocaleDateString("fa-IR").replaceAll("/", "-");
|
|
21957
21959
|
const fileName = `${title}_${dateForFile}.xlsx`;
|
|
21958
|
-
XLSX
|
|
21960
|
+
XLSX.writeFile(wb, fileName);
|
|
21959
21961
|
};
|
|
21960
21962
|
const handleExport = async () => {
|
|
21961
21963
|
var _a, _b, _c;
|
|
@@ -22002,7 +22004,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
|
|
|
22002
22004
|
} else {
|
|
22003
22005
|
exportLoading.value = true;
|
|
22004
22006
|
try {
|
|
22005
|
-
handleExportClientSide();
|
|
22007
|
+
await handleExportClientSide();
|
|
22006
22008
|
} finally {
|
|
22007
22009
|
exportLoading.value = false;
|
|
22008
22010
|
}
|