@atomsolution/sdk-merchant 1.8.4 → 1.8.5
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/assets/locales/en/file.json.d.ts +2 -2
- package/dist/assets/locales/vi/file.json.d.ts +2 -2
- package/dist/batch-product-creation/components/merchant-batch-create-form/product-info-preview/index.d.ts +1 -1
- package/dist/batch-product-creation.cjs +42 -35
- package/dist/batch-product-creation.cjs.map +1 -1
- package/dist/batch-product-creation.esm.js +42 -35
- package/dist/batch-product-creation.esm.js.map +1 -1
- package/dist/batch-product-creation.js +42 -35
- package/dist/batch-product-creation.js.map +1 -1
- package/dist/components/common/dataTable/tableHeader.d.ts +1 -1
- package/dist/digistore.cjs +1 -1
- package/dist/digistore.esm.js +1 -1
- package/dist/digistore.js +1 -1
- package/dist/{dropdownMenuAbsolute-BvDBLhd-.js → dropdownMenuAbsolute-0z-SL48l.js} +4 -6
- package/dist/{dropdownMenuAbsolute-BvDBLhd-.js.map → dropdownMenuAbsolute-0z-SL48l.js.map} +1 -1
- package/dist/{dropdownMenuAbsolute-djdsnyTz.cjs → dropdownMenuAbsolute-t4SPWS3W.cjs} +4 -6
- package/dist/{dropdownMenuAbsolute-djdsnyTz.cjs.map → dropdownMenuAbsolute-t4SPWS3W.cjs.map} +1 -1
- package/dist/merchant-profile.cjs +2 -2
- package/dist/merchant-profile.esm.js +2 -2
- package/dist/merchant-profile.js +2 -2
- package/dist/shared.cjs +1 -1
- package/dist/shared.esm.js +1 -1
- package/dist/shared.js +1 -1
- package/dist/{use-external-config.store-CAZvrNUF.js → use-external-config.store-CaaNmLce.js} +2 -2
- package/dist/{use-external-config.store-CAZvrNUF.js.map → use-external-config.store-CaaNmLce.js.map} +1 -1
- package/dist/{use-external-config.store-D2beE35F.cjs → use-external-config.store-WVwivWvK.cjs} +2 -2
- package/dist/{use-external-config.store-D2beE35F.cjs.map → use-external-config.store-WVwivWvK.cjs.map} +1 -1
- package/dist/{use-translation-CD6xknr3.cjs → use-translation-Ba-GPTbc.cjs} +6 -6
- package/dist/{use-translation-CD6xknr3.cjs.map → use-translation-Ba-GPTbc.cjs.map} +1 -1
- package/dist/{use-translation-DFiePp2h.js → use-translation-Dpu_N-4j.js} +6 -6
- package/dist/{use-translation-DFiePp2h.js.map → use-translation-Dpu_N-4j.js.map} +1 -1
- package/package.json +1 -1
|
@@ -25,8 +25,8 @@ declare const _default: {
|
|
|
25
25
|
"Product Category"
|
|
26
26
|
],
|
|
27
27
|
"title": "Upload Product List",
|
|
28
|
-
"instruction1": "
|
|
29
|
-
"instruction2": "
|
|
28
|
+
"instruction1": "Each upload is limited to 1 file and up to 100 rows of information (products).",
|
|
29
|
+
"instruction2": "If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).",
|
|
30
30
|
"deleteFile": "Delete file",
|
|
31
31
|
"tabs": {
|
|
32
32
|
"sampleDownload": "Download sample file",
|
|
@@ -25,8 +25,8 @@ declare const _default: {
|
|
|
25
25
|
"Danh mục sản phẩm"
|
|
26
26
|
],
|
|
27
27
|
"title": "Tải lên danh sách sản phẩm",
|
|
28
|
-
"instruction1": "
|
|
29
|
-
"instruction2": "
|
|
28
|
+
"instruction1": "Mỗi lượt tải lên danh sách chỉ được tối đa 01 tệp và tối đa 100 dòng thông tin (sản phẩm).",
|
|
29
|
+
"instruction2": "Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).",
|
|
30
30
|
"deleteFile": "Xóa file",
|
|
31
31
|
"tabs": {
|
|
32
32
|
"sampleDownload": "Tải xuống tệp mẫu",
|
|
@@ -70,13 +70,13 @@ var __asyncGenerator = (__this, __arguments, generator) => {
|
|
|
70
70
|
var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
|
|
71
71
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
72
72
|
const jsxRuntime = require("./jsx-runtime-DV8UmLi4.cjs");
|
|
73
|
-
const useTranslation = require("./use-translation-
|
|
73
|
+
const useTranslation = require("./use-translation-Ba-GPTbc.cjs");
|
|
74
74
|
const reactToastify = require("react-toastify");
|
|
75
75
|
const useWesapApiConfig_store = require("./use-wesap-api-config.store-BaseWS--.cjs");
|
|
76
76
|
const React = require("react");
|
|
77
77
|
const create = require("zustand");
|
|
78
|
-
const useExternalConfig_store = require("./use-external-config.store-
|
|
79
|
-
const dropdownMenuAbsolute = require("./dropdownMenuAbsolute-
|
|
78
|
+
const useExternalConfig_store = require("./use-external-config.store-WVwivWvK.cjs");
|
|
79
|
+
const dropdownMenuAbsolute = require("./dropdownMenuAbsolute-t4SPWS3W.cjs");
|
|
80
80
|
const ReactDOM = require("react-dom");
|
|
81
81
|
const index = require("./index-Ozgk-K52.cjs");
|
|
82
82
|
const axios = require("axios");
|
|
@@ -58000,36 +58000,42 @@ const ProductPreviewTable = ({
|
|
|
58000
58000
|
});
|
|
58001
58001
|
}
|
|
58002
58002
|
React.useEffect(() => {
|
|
58003
|
-
|
|
58004
|
-
const resetProducts = productsTableData2.map((product) => __spreadProps(__spreadValues({}, product), {
|
|
58005
|
-
note: ""
|
|
58006
|
-
}));
|
|
58007
|
-
return resetProducts;
|
|
58008
|
-
};
|
|
58009
|
-
const validate = () => __async(exports, null, function* () {
|
|
58010
|
-
const resetErrorProducts = handleResetValidateMessages(productsTableData);
|
|
58011
|
-
yield handleValidateProductsExist(resetErrorProducts);
|
|
58012
|
-
const validated = resetErrorProducts.map((product) => {
|
|
58013
|
-
let errors = "";
|
|
58014
|
-
const schema = createProductPreviewSchema(translate, taxDeductionMethod);
|
|
58015
|
-
const result = schema.safeParse(product);
|
|
58016
|
-
if (!result.success) {
|
|
58017
|
-
const fields = /* @__PURE__ */ new Set();
|
|
58018
|
-
const zErrors = result.error.issues.filter((error) => {
|
|
58019
|
-
if (fields.has(error.path[0])) return false;
|
|
58020
|
-
fields.add(error.path[0]);
|
|
58021
|
-
return true;
|
|
58022
|
-
}).map((error) => error.message).join("\n");
|
|
58023
|
-
errors = errors + zErrors;
|
|
58024
|
-
}
|
|
58025
|
-
product.note = product.note + errors;
|
|
58026
|
-
return product;
|
|
58027
|
-
});
|
|
58028
|
-
setValidatedProducts(validated);
|
|
58003
|
+
if (productsTableData.length === 0) {
|
|
58029
58004
|
setLoading(false);
|
|
58005
|
+
return;
|
|
58006
|
+
}
|
|
58007
|
+
let isMounted = true;
|
|
58008
|
+
const validate = () => __async(exports, null, function* () {
|
|
58009
|
+
setLoading(true);
|
|
58010
|
+
const productsToValidate = productsTableData.map((p) => __spreadProps(__spreadValues({}, p), { note: "" }));
|
|
58011
|
+
try {
|
|
58012
|
+
yield handleValidateProductsExist(productsToValidate);
|
|
58013
|
+
if (!isMounted) return;
|
|
58014
|
+
const finalValidated = productsToValidate.map((product) => {
|
|
58015
|
+
var _a;
|
|
58016
|
+
let errors = "";
|
|
58017
|
+
const schema = createProductPreviewSchema(translate, taxDeductionMethod);
|
|
58018
|
+
const result = schema.safeParse(product);
|
|
58019
|
+
if (!result.success) {
|
|
58020
|
+
errors = ((_a = result.error.issues[0]) == null ? void 0 : _a.message) || "";
|
|
58021
|
+
}
|
|
58022
|
+
return __spreadProps(__spreadValues({}, product), { note: product.note + errors });
|
|
58023
|
+
});
|
|
58024
|
+
setValidatedProducts(finalValidated);
|
|
58025
|
+
} catch (err) {
|
|
58026
|
+
console.error(err);
|
|
58027
|
+
} finally {
|
|
58028
|
+
if (isMounted) setLoading(false);
|
|
58029
|
+
}
|
|
58030
58030
|
});
|
|
58031
|
-
|
|
58032
|
-
|
|
58031
|
+
const timeoutId = setTimeout(() => {
|
|
58032
|
+
validate();
|
|
58033
|
+
}, 500);
|
|
58034
|
+
return () => {
|
|
58035
|
+
isMounted = false;
|
|
58036
|
+
clearTimeout(timeoutId);
|
|
58037
|
+
};
|
|
58038
|
+
}, [productsTableData, taxDeductionMethod]);
|
|
58033
58039
|
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "overflow-x-auto", children: [
|
|
58034
58040
|
loading ? /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(dropdownMenuAbsolute.TableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
|
|
58035
58041
|
dropdownMenuAbsolute.ReusableTable,
|
|
@@ -58067,7 +58073,9 @@ const ProductInfoPreview = ({ taxDeductionMethod }) => {
|
|
|
58067
58073
|
const [showCreateProductConfirmModal, setShowCreateProductConfirmModal] = React.useState(false);
|
|
58068
58074
|
const [showCreateSuccessModal, setShowSuccessModal] = React.useState(false);
|
|
58069
58075
|
const [checkedProducts, setCheckedProducts] = React.useState([]);
|
|
58070
|
-
const [createdProductsResult, setCreatedProductsResult] = React.useState(
|
|
58076
|
+
const [createdProductsResult, setCreatedProductsResult] = React.useState(
|
|
58077
|
+
null
|
|
58078
|
+
);
|
|
58071
58079
|
const { sheetMappingData, selectedSheet, uploadedFile, reset } = useUploadStore();
|
|
58072
58080
|
const filterRow = sheetMappingData.filter((row) => {
|
|
58073
58081
|
return row.code || row.name || row.priceAfterTax || row.unit || row.category;
|
|
@@ -58097,8 +58105,7 @@ const ProductInfoPreview = ({ taxDeductionMethod }) => {
|
|
|
58097
58105
|
translate("upload_information_description2"),
|
|
58098
58106
|
" ",
|
|
58099
58107
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("strong", { className: "text-[#1E2A7B]", children: uploadedFile == null ? void 0 : uploadedFile.name }),
|
|
58100
|
-
",",
|
|
58101
|
-
" ",
|
|
58108
|
+
", ",
|
|
58102
58109
|
translate("sheet"),
|
|
58103
58110
|
" ",
|
|
58104
58111
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("strong", { className: "text-[#1E2A7B]", children: selectedSheet })
|
|
@@ -58125,7 +58132,7 @@ const ProductInfoPreview = ({ taxDeductionMethod }) => {
|
|
|
58125
58132
|
setCreatedProductsResult(data);
|
|
58126
58133
|
setShowSuccessModal(true);
|
|
58127
58134
|
},
|
|
58128
|
-
numCheckedProducts: `${checkedProducts.length}/${
|
|
58135
|
+
numCheckedProducts: `${checkedProducts.length}/${filterRow.length}`,
|
|
58129
58136
|
checkedProducts,
|
|
58130
58137
|
taxDeductionMethod
|
|
58131
58138
|
}
|