@amirjalili1374/ui-kit 1.5.82 → 1.5.84
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 +3 -0
- package/dist/components/shared/CustomDataTable.vue.d.ts.map +1 -1
- package/dist/components/shared/ShamsiDatePicker.vue.d.ts +1 -0
- package/dist/components/shared/ShamsiDatePicker.vue.d.ts.map +1 -1
- package/dist/services/apiService.d.ts +1 -0
- package/dist/services/apiService.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/componentTypes/DataTableTypes.d.ts +4 -0
- package/dist/types/componentTypes/DataTableTypes.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 +75 -6
- package/dist/ui-kit.es.js.map +1 -1
- package/package.json +1 -1
package/dist/ui-kit.es.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp2 = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp2 = (obj, key2, value2) => key2 in obj ? __defProp2(obj, key2, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key2] = value2;
|
|
3
3
|
var __publicField = (obj, key2, value2) => __defNormalProp2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value2);
|
|
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, onUnmounted } from "vue";
|
|
5
|
-
import { IconHome, IconArrowBadgeLeft, IconCheck, IconSquareX, IconChevronDown, IconChevronRight, IconMinus, IconPlus, IconRefresh, IconChevronLeft, IconDownload, IconPrinter, IconMaximize, IconMinimize, IconX, IconFileText, IconPencil, IconClock, IconMenu2, IconPalette } from "@tabler/icons-vue";
|
|
5
|
+
import { IconHome, IconArrowBadgeLeft, IconFileExport, IconCheck, IconSquareX, IconChevronDown, IconChevronRight, IconMinus, IconPlus, IconRefresh, IconChevronLeft, IconDownload, IconPrinter, IconMaximize, IconMinimize, IconX, IconFileText, IconPencil, IconClock, IconMenu2, IconPalette } from "@tabler/icons-vue";
|
|
6
6
|
import axios from "axios";
|
|
7
7
|
import { useDebounceFn } from "@vueuse/core";
|
|
8
8
|
import { useRouter as useRouter$1 } from "vue-router";
|
|
@@ -13962,7 +13962,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
13962
13962
|
type: { default: "date" },
|
|
13963
13963
|
outputFormat: { default: "iso" },
|
|
13964
13964
|
format: {},
|
|
13965
|
-
displayFormat: {}
|
|
13965
|
+
displayFormat: {},
|
|
13966
|
+
disabledDates: {}
|
|
13966
13967
|
},
|
|
13967
13968
|
emits: ["update:modelValue"],
|
|
13968
13969
|
setup(__props, { emit: __emit }) {
|
|
@@ -14060,7 +14061,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
14060
14061
|
"display-format": internalDisplayFormat.value,
|
|
14061
14062
|
editable: false,
|
|
14062
14063
|
clearable: __props.clearable,
|
|
14063
|
-
|
|
14064
|
+
disable: __props.disabledDates,
|
|
14064
14065
|
min: __props.minDate,
|
|
14065
14066
|
max: __props.maxDate,
|
|
14066
14067
|
placeholder: __props.placeholder,
|
|
@@ -14069,12 +14070,12 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
14069
14070
|
range: isRangeMode.value,
|
|
14070
14071
|
color: __props.color,
|
|
14071
14072
|
onChange: onDateChange
|
|
14072
|
-
}, null, 8, ["label", "modelValue", "type", "format", "display-format", "clearable", "
|
|
14073
|
+
}, null, 8, ["label", "modelValue", "type", "format", "display-format", "clearable", "disable", "min", "max", "placeholder", "input-class", "wrapper-class", "range", "color"])
|
|
14073
14074
|
]);
|
|
14074
14075
|
};
|
|
14075
14076
|
}
|
|
14076
14077
|
});
|
|
14077
|
-
const ShamsiDatePicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-
|
|
14078
|
+
const ShamsiDatePicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-aa4ee32a"]]);
|
|
14078
14079
|
const _hoisted_1$a = { class: "mb-6" };
|
|
14079
14080
|
const _hoisted_2$6 = { class: "text-subtitle-1 font-weight-medium mb-3" };
|
|
14080
14081
|
const _hoisted_3$4 = { class: "theme-toggle-container" };
|
|
@@ -14337,6 +14338,14 @@ function apiService(axiosInst, resource) {
|
|
|
14337
14338
|
async get(id) {
|
|
14338
14339
|
const response = await axiosInst.get(`${baseUrl}/${id}`);
|
|
14339
14340
|
return response;
|
|
14341
|
+
},
|
|
14342
|
+
async exportExcel(params = {}, customUrl) {
|
|
14343
|
+
const url = customUrl || baseUrl;
|
|
14344
|
+
const response = await axiosInst.get(url, {
|
|
14345
|
+
params,
|
|
14346
|
+
responseType: "blob"
|
|
14347
|
+
});
|
|
14348
|
+
return response;
|
|
14340
14349
|
}
|
|
14341
14350
|
};
|
|
14342
14351
|
}
|
|
@@ -18332,12 +18341,17 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18332
18341
|
enableTextTruncation: { type: Boolean, default: false },
|
|
18333
18342
|
maxTextLength: { default: 50 },
|
|
18334
18343
|
filterAdapter: {},
|
|
18335
|
-
inlineFilter: { type: Boolean, default: false }
|
|
18344
|
+
inlineFilter: { type: Boolean, default: false },
|
|
18345
|
+
filters: {},
|
|
18346
|
+
enableExport: { type: Boolean, default: false },
|
|
18347
|
+
exportUrl: { default: "" },
|
|
18348
|
+
exportFileName: { default: "" }
|
|
18336
18349
|
},
|
|
18337
18350
|
emits: ["update:selectedItems", "selection-change"],
|
|
18338
18351
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
18339
18352
|
const filters = reactive({});
|
|
18340
18353
|
const initialized = ref(false);
|
|
18354
|
+
const exportLoading = ref(false);
|
|
18341
18355
|
const props = __props;
|
|
18342
18356
|
const emit = __emit;
|
|
18343
18357
|
watch(filters, () => {
|
|
@@ -18694,6 +18708,40 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18694
18708
|
emit("update:selectedItems", selectedItems.value);
|
|
18695
18709
|
emit("selection-change", selectedItems.value);
|
|
18696
18710
|
};
|
|
18711
|
+
const handleExport = async () => {
|
|
18712
|
+
try {
|
|
18713
|
+
exportLoading.value = true;
|
|
18714
|
+
const rawFilter = buildFilterParams();
|
|
18715
|
+
const finalFilter = resolveFilter(rawFilter);
|
|
18716
|
+
const hasExternalCriteria = externalCriteria.value && Object.keys(externalCriteria.value).length > 0;
|
|
18717
|
+
let params = {
|
|
18718
|
+
...hasExternalCriteria ? {} : finalFilter,
|
|
18719
|
+
...props.queryParams,
|
|
18720
|
+
...externalCriteria.value || {}
|
|
18721
|
+
};
|
|
18722
|
+
if (props.showPagination !== false) {
|
|
18723
|
+
params = {
|
|
18724
|
+
...params,
|
|
18725
|
+
page: currentPage.value - 1,
|
|
18726
|
+
size: itemsPerPage.value
|
|
18727
|
+
};
|
|
18728
|
+
}
|
|
18729
|
+
const response = await api.exportExcel(params, props.exportUrl);
|
|
18730
|
+
const blob = new Blob([response.data], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
|
|
18731
|
+
const url = window.URL.createObjectURL(blob);
|
|
18732
|
+
const link = document.createElement("a");
|
|
18733
|
+
link.href = url;
|
|
18734
|
+
link.download = props.exportFileName || "export.xlsx";
|
|
18735
|
+
document.body.appendChild(link);
|
|
18736
|
+
link.click();
|
|
18737
|
+
document.body.removeChild(link);
|
|
18738
|
+
window.URL.revokeObjectURL(url);
|
|
18739
|
+
} catch (err) {
|
|
18740
|
+
console.error("Export Error:", err);
|
|
18741
|
+
} finally {
|
|
18742
|
+
exportLoading.value = false;
|
|
18743
|
+
}
|
|
18744
|
+
};
|
|
18697
18745
|
const selectSingleItem = (item) => {
|
|
18698
18746
|
selection.clearSelection();
|
|
18699
18747
|
selection.selectedItems.value = [item];
|
|
@@ -19510,6 +19558,27 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
19510
19558
|
])]),
|
|
19511
19559
|
_: 1
|
|
19512
19560
|
}, 8, ["loading"])) : createCommentVNode("", true),
|
|
19561
|
+
__props.enableExport ? (openBlock(), createBlock(VBtn, {
|
|
19562
|
+
key: 5,
|
|
19563
|
+
icon: "",
|
|
19564
|
+
class: "text-secondary mx-3",
|
|
19565
|
+
color: "lightsecondary",
|
|
19566
|
+
rounded: "sm",
|
|
19567
|
+
size: "small",
|
|
19568
|
+
variant: "flat",
|
|
19569
|
+
loading: exportLoading.value,
|
|
19570
|
+
disabled: loading.value,
|
|
19571
|
+
onClick: handleExport,
|
|
19572
|
+
title: "خروجی اکسل"
|
|
19573
|
+
}, {
|
|
19574
|
+
default: withCtx(() => [
|
|
19575
|
+
createVNode(unref(IconFileExport), {
|
|
19576
|
+
"stroke-width": "1.5",
|
|
19577
|
+
size: "22"
|
|
19578
|
+
})
|
|
19579
|
+
]),
|
|
19580
|
+
_: 1
|
|
19581
|
+
}, 8, ["loading", "disabled"])) : createCommentVNode("", true),
|
|
19513
19582
|
createVNode(Transition, {
|
|
19514
19583
|
name: "slide-left",
|
|
19515
19584
|
appear: ""
|