@amirjalili1374/ui-kit 1.4.32 → 1.4.34
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/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/ui-kit.cjs.js +1 -1
- package/dist/ui-kit.cjs.js.map +1 -1
- package/dist/ui-kit.es.js +75 -2
- 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: {
|
|
@@ -17790,6 +17791,78 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17790
17791
|
console.error(`Error converting date for field ${header.key}:`, error2);
|
|
17791
17792
|
}
|
|
17792
17793
|
}
|
|
17794
|
+
if (hasAutocomplete(header)) {
|
|
17795
|
+
const enhancedHeader = header;
|
|
17796
|
+
const currentValue = dataToSave[header.key];
|
|
17797
|
+
const valueKey = resolveAutocompleteItemValue(header);
|
|
17798
|
+
if (enhancedHeader.autocompleteMultiple && Array.isArray(currentValue)) {
|
|
17799
|
+
const autocompleteItems = resolveAutocompleteItems(header, dataToSave);
|
|
17800
|
+
const processedArray = currentValue.map((item) => {
|
|
17801
|
+
if (item === null || item === void 0) {
|
|
17802
|
+
return null;
|
|
17803
|
+
}
|
|
17804
|
+
if (enhancedHeader.autocompleteReturnObject !== false) {
|
|
17805
|
+
if (typeof item !== "object") {
|
|
17806
|
+
return null;
|
|
17807
|
+
}
|
|
17808
|
+
const itemValue = valueKey && item[valueKey];
|
|
17809
|
+
if (itemValue !== null && itemValue !== void 0) {
|
|
17810
|
+
const fullItem = autocompleteItems.find((autocompleteItem) => {
|
|
17811
|
+
const autocompleteValue = autocompleteItem[valueKey];
|
|
17812
|
+
return autocompleteValue !== null && autocompleteValue !== void 0 && String(autocompleteValue) === String(itemValue);
|
|
17813
|
+
});
|
|
17814
|
+
if (fullItem && typeof fullItem === "object") {
|
|
17815
|
+
return fullItem;
|
|
17816
|
+
}
|
|
17817
|
+
}
|
|
17818
|
+
const propertyValues = Object.values(item);
|
|
17819
|
+
if (propertyValues.length === 0) {
|
|
17820
|
+
return null;
|
|
17821
|
+
}
|
|
17822
|
+
const allPropertiesEmpty = propertyValues.every(
|
|
17823
|
+
(val2) => val2 === null || val2 === void 0 || val2 === ""
|
|
17824
|
+
);
|
|
17825
|
+
if (allPropertiesEmpty) {
|
|
17826
|
+
return null;
|
|
17827
|
+
}
|
|
17828
|
+
return item;
|
|
17829
|
+
}
|
|
17830
|
+
return item !== null && item !== void 0 && item !== "" ? item : null;
|
|
17831
|
+
}).filter((item) => item !== null && item !== void 0);
|
|
17832
|
+
dataToSave[header.key] = processedArray;
|
|
17833
|
+
} else if (currentValue === null || currentValue === void 0 || currentValue === "") {
|
|
17834
|
+
dataToSave[header.key] = null;
|
|
17835
|
+
} else if (enhancedHeader.autocompleteReturnObject !== false && typeof currentValue === "object") {
|
|
17836
|
+
const autocompleteItems = resolveAutocompleteItems(header, dataToSave);
|
|
17837
|
+
const valueKey2 = resolveAutocompleteItemValue(header);
|
|
17838
|
+
const itemValue = valueKey2 && currentValue[valueKey2];
|
|
17839
|
+
if (itemValue !== null && itemValue !== void 0) {
|
|
17840
|
+
const fullItem = autocompleteItems.find((autocompleteItem) => {
|
|
17841
|
+
const autocompleteValue = autocompleteItem[valueKey2];
|
|
17842
|
+
return autocompleteValue !== null && autocompleteValue !== void 0 && String(autocompleteValue) === String(itemValue);
|
|
17843
|
+
});
|
|
17844
|
+
if (fullItem && typeof fullItem === "object") {
|
|
17845
|
+
dataToSave[header.key] = fullItem;
|
|
17846
|
+
}
|
|
17847
|
+
}
|
|
17848
|
+
}
|
|
17849
|
+
}
|
|
17850
|
+
});
|
|
17851
|
+
props.headers.forEach((header) => {
|
|
17852
|
+
if (hasAutocomplete(header) && dataToSave[header.key]) {
|
|
17853
|
+
const enhancedHeader = header;
|
|
17854
|
+
if (enhancedHeader.autocompleteMultiple && Array.isArray(dataToSave[header.key])) {
|
|
17855
|
+
console.log(`[CustomDataTable] Autocomplete field "${header.key}" (${dataToSave[header.key].length} items) before save:`, dataToSave[header.key]);
|
|
17856
|
+
const itemsWithNulls = dataToSave[header.key].filter(
|
|
17857
|
+
(item) => item && typeof item === "object" && Object.values(item).some((val2) => val2 === null)
|
|
17858
|
+
);
|
|
17859
|
+
if (itemsWithNulls.length > 0) {
|
|
17860
|
+
console.warn(`[CustomDataTable] Warning: Found ${itemsWithNulls.length} items with null properties in "${header.key}":`, itemsWithNulls);
|
|
17861
|
+
}
|
|
17862
|
+
} else {
|
|
17863
|
+
console.log(`[CustomDataTable] Autocomplete field "${header.key}" before save:`, dataToSave[header.key]);
|
|
17864
|
+
}
|
|
17865
|
+
}
|
|
17793
17866
|
});
|
|
17794
17867
|
if (isEditing.value && dataToSave.id) {
|
|
17795
17868
|
await api.update(dataToSave);
|