@amirjalili1374/ui-kit 1.4.34 → 1.4.38
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/layout/AppLayout.vue.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.vue.d.ts +9 -1
- package/dist/components/layout/AppSidebar.vue.d.ts.map +1 -1
- package/dist/components/shared/CustomDataTable.vue.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/componentTypes/DataTableTypes.d.ts +1 -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 +44 -27
- package/dist/ui-kit.es.js.map +1 -1
- package/package.json +1 -1
package/dist/ui-kit.es.js
CHANGED
|
@@ -17121,7 +17121,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17121
17121
|
bulkMode: { type: Boolean, default: false },
|
|
17122
17122
|
axiosInstance: {},
|
|
17123
17123
|
enableTextTruncation: { type: Boolean, default: false },
|
|
17124
|
-
maxTextLength: { default: 50 }
|
|
17124
|
+
maxTextLength: { default: 50 },
|
|
17125
|
+
filterAdapter: {}
|
|
17125
17126
|
},
|
|
17126
17127
|
emits: ["update:selectedItems", "selection-change"],
|
|
17127
17128
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -17533,18 +17534,27 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17533
17534
|
computed(() => {
|
|
17534
17535
|
return !!props.filterComponent;
|
|
17535
17536
|
});
|
|
17537
|
+
const applyFilterAdapter = (raw) => {
|
|
17538
|
+
if (!props.filterAdapter) return raw;
|
|
17539
|
+
return props.filterAdapter(raw);
|
|
17540
|
+
};
|
|
17536
17541
|
const fetchData = async (queryParams) => {
|
|
17537
17542
|
var _a, _b, _c;
|
|
17538
17543
|
loading.value = true;
|
|
17539
17544
|
error.value = null;
|
|
17540
|
-
let params = {
|
|
17541
|
-
...buildFilterParams(),
|
|
17542
|
-
...props.queryParams
|
|
17543
|
-
};
|
|
17544
|
-
if (queryParams) {
|
|
17545
|
-
params = { ...params, ...queryParams };
|
|
17546
|
-
}
|
|
17547
17545
|
try {
|
|
17546
|
+
const rawFilter = buildFilterParams();
|
|
17547
|
+
const adaptedFilter = applyFilterAdapter(rawFilter);
|
|
17548
|
+
let params = {
|
|
17549
|
+
...adaptedFilter,
|
|
17550
|
+
...props.queryParams
|
|
17551
|
+
};
|
|
17552
|
+
if (queryParams) {
|
|
17553
|
+
params = {
|
|
17554
|
+
...params,
|
|
17555
|
+
...queryParams
|
|
17556
|
+
};
|
|
17557
|
+
}
|
|
17548
17558
|
const shouldPaginate = props.showPagination !== false;
|
|
17549
17559
|
const requestParams = shouldPaginate ? {
|
|
17550
17560
|
...params,
|
|
@@ -17558,12 +17568,10 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17558
17568
|
} else {
|
|
17559
17569
|
if (Array.isArray(response.data)) {
|
|
17560
17570
|
serverRawData = response.data;
|
|
17561
|
-
} else if (((_b = response.data) == null ? void 0 : _b.content)
|
|
17571
|
+
} else if (Array.isArray((_b = response.data) == null ? void 0 : _b.content)) {
|
|
17562
17572
|
serverRawData = response.data.content;
|
|
17563
|
-
} else if (response.data && typeof response.data === "object"
|
|
17573
|
+
} else if (response.data && typeof response.data === "object") {
|
|
17564
17574
|
serverRawData = [response.data];
|
|
17565
|
-
} else {
|
|
17566
|
-
serverRawData = [];
|
|
17567
17575
|
}
|
|
17568
17576
|
}
|
|
17569
17577
|
const serverData = Array.isArray(serverRawData) ? serverRawData : [];
|
|
@@ -17574,8 +17582,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17574
17582
|
if (isDateHeader(header) && newItem[header.key]) {
|
|
17575
17583
|
try {
|
|
17576
17584
|
newItem[header.key] = DateConverter.toShamsi(newItem[header.key]);
|
|
17577
|
-
} catch (
|
|
17578
|
-
console.error(`
|
|
17585
|
+
} catch (e) {
|
|
17586
|
+
console.error(`Date convert error: ${header.key}`, e);
|
|
17579
17587
|
}
|
|
17580
17588
|
}
|
|
17581
17589
|
});
|
|
@@ -17590,7 +17598,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17590
17598
|
totalPages.value = 1;
|
|
17591
17599
|
hasMore.value = false;
|
|
17592
17600
|
}
|
|
17593
|
-
if (props.defaultSelected && items.value.length
|
|
17601
|
+
if (props.defaultSelected && items.value.length && props.defaultSelected in items.value[0]) {
|
|
17594
17602
|
const defaultSelectedItems = items.value.filter((item) => item[props.defaultSelected] === true);
|
|
17595
17603
|
selectedItems.value = [...defaultSelectedItems];
|
|
17596
17604
|
emit("update:selectedItems", selectedItems.value);
|
|
@@ -17598,7 +17606,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17598
17606
|
}
|
|
17599
17607
|
} catch (err) {
|
|
17600
17608
|
if (err.response) {
|
|
17601
|
-
error.value = `خطای سرور: ${err.response.status}
|
|
17609
|
+
error.value = `خطای سرور: ${err.response.status}`;
|
|
17602
17610
|
} else if (err.request) {
|
|
17603
17611
|
error.value = "خطای شبکه. لطفا دوباره تلاش کنید.";
|
|
17604
17612
|
} else {
|
|
@@ -17819,9 +17827,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17819
17827
|
if (propertyValues.length === 0) {
|
|
17820
17828
|
return null;
|
|
17821
17829
|
}
|
|
17822
|
-
const allPropertiesEmpty = propertyValues.every(
|
|
17823
|
-
(val2) => val2 === null || val2 === void 0 || val2 === ""
|
|
17824
|
-
);
|
|
17830
|
+
const allPropertiesEmpty = propertyValues.every((val2) => val2 === null || val2 === void 0 || val2 === "");
|
|
17825
17831
|
if (allPropertiesEmpty) {
|
|
17826
17832
|
return null;
|
|
17827
17833
|
}
|
|
@@ -17852,12 +17858,18 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17852
17858
|
if (hasAutocomplete(header) && dataToSave[header.key]) {
|
|
17853
17859
|
const enhancedHeader = header;
|
|
17854
17860
|
if (enhancedHeader.autocompleteMultiple && Array.isArray(dataToSave[header.key])) {
|
|
17855
|
-
console.log(
|
|
17861
|
+
console.log(
|
|
17862
|
+
`[CustomDataTable] Autocomplete field "${header.key}" (${dataToSave[header.key].length} items) before save:`,
|
|
17863
|
+
dataToSave[header.key]
|
|
17864
|
+
);
|
|
17856
17865
|
const itemsWithNulls = dataToSave[header.key].filter(
|
|
17857
17866
|
(item) => item && typeof item === "object" && Object.values(item).some((val2) => val2 === null)
|
|
17858
17867
|
);
|
|
17859
17868
|
if (itemsWithNulls.length > 0) {
|
|
17860
|
-
console.warn(
|
|
17869
|
+
console.warn(
|
|
17870
|
+
`[CustomDataTable] Warning: Found ${itemsWithNulls.length} items with null properties in "${header.key}":`,
|
|
17871
|
+
itemsWithNulls
|
|
17872
|
+
);
|
|
17861
17873
|
}
|
|
17862
17874
|
} else {
|
|
17863
17875
|
console.log(`[CustomDataTable] Autocomplete field "${header.key}" before save:`, dataToSave[header.key]);
|
|
@@ -38144,6 +38156,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent$1({
|
|
|
38144
38156
|
miniSidebar: {
|
|
38145
38157
|
type: Boolean,
|
|
38146
38158
|
required: true
|
|
38159
|
+
},
|
|
38160
|
+
version: {
|
|
38161
|
+
type: String,
|
|
38162
|
+
required: false
|
|
38147
38163
|
}
|
|
38148
38164
|
},
|
|
38149
38165
|
emits: ["update:sidebarDrawer"],
|
|
@@ -38209,9 +38225,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent$1({
|
|
|
38209
38225
|
color: "inputBorder",
|
|
38210
38226
|
size: "small"
|
|
38211
38227
|
}, {
|
|
38212
|
-
default: withCtx(() => [
|
|
38213
|
-
createTextVNode("نمایشی",
|
|
38214
|
-
])
|
|
38228
|
+
default: withCtx(() => [
|
|
38229
|
+
createTextVNode(toDisplayString(props.version ? props.version : "نمایشی"), 1)
|
|
38230
|
+
]),
|
|
38215
38231
|
_: 1
|
|
38216
38232
|
})
|
|
38217
38233
|
])) : createCommentVNode("", true)
|
|
@@ -38224,7 +38240,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent$1({
|
|
|
38224
38240
|
};
|
|
38225
38241
|
}
|
|
38226
38242
|
});
|
|
38227
|
-
const AppSidebar = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__scopeId", "data-v-
|
|
38243
|
+
const AppSidebar = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__scopeId", "data-v-b59df261"]]);
|
|
38228
38244
|
const makeVToolbarTitleProps = propsFactory({
|
|
38229
38245
|
text: String,
|
|
38230
38246
|
...makeComponentProps(),
|
|
@@ -38970,7 +38986,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent$1({
|
|
|
38970
38986
|
sidebarDrawer: __props.sidebar.sidebarDrawer,
|
|
38971
38987
|
miniSidebar: __props.sidebar.miniSidebar,
|
|
38972
38988
|
"onUpdate:sidebarDrawer": __props.sidebar["onUpdate:sidebarDrawer"],
|
|
38973
|
-
class: "app-sidebar"
|
|
38989
|
+
class: "app-sidebar",
|
|
38990
|
+
version: "1.0.0"
|
|
38974
38991
|
}, null, 8, ["sidebarItems", "getFilteredSidebarItems", "logoComponent", "sidebarDrawer", "miniSidebar", "onUpdate:sidebarDrawer"]),
|
|
38975
38992
|
createVNode(VMain, null, {
|
|
38976
38993
|
default: withCtx(() => [
|
|
@@ -38986,7 +39003,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent$1({
|
|
|
38986
39003
|
};
|
|
38987
39004
|
}
|
|
38988
39005
|
});
|
|
38989
|
-
const AppLayout = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__scopeId", "data-v-
|
|
39006
|
+
const AppLayout = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__scopeId", "data-v-8eddbad4"]]);
|
|
38990
39007
|
function useDataTable(options) {
|
|
38991
39008
|
const items = ref([]);
|
|
38992
39009
|
const loading = ref(false);
|