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