@atomsolution/sdk-merchant 1.6.0 → 1.6.2

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.
@@ -29150,32 +29150,48 @@ var Title = DialogTitle;
29150
29150
  var Description = DialogDescription;
29151
29151
  var Close = DialogClose;
29152
29152
  const closeIcon = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%206L6%2018'%20stroke='url(%23paint0_linear_10838_182207)'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6%206L18%2018'%20stroke='url(%23paint1_linear_10838_182207)'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_10838_182207'%20x1='6'%20y1='6.41753'%20x2='19.5738'%20y2='8.22863'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23001E3F'/%3e%3cstop%20offset='1'%20stop-color='%23181427'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_10838_182207'%20x1='18'%20y1='6.41753'%20x2='4.42619'%20y2='8.22863'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23001E3F'/%3e%3cstop%20offset='1'%20stop-color='%23181427'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
29153
- const WrapModal = ({ open, className, onClose, children }) => {
29154
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Root$1, { open, onOpenChange: onClose, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Portal, { children: [
29155
- /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { className: "fixed inset-0 bg-black/30 data-[state=open]:animate-overlayShow" }),
29156
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
29157
- Content,
29158
- {
29159
- className: twMerge(
29160
- "fixed left-1/2 top-1/2 max-h-[95vh] overflow-y-auto -translate-x-1/2 -translate-y-1/2 rounded-2xl bg-white p-10 shadow-md focus:outline-none data-[state=open]:animate-contentShow",
29161
- className
29162
- ),
29163
- children: [
29164
- /* @__PURE__ */ jsxRuntimeExports.jsx(Title, {}),
29165
- /* @__PURE__ */ jsxRuntimeExports.jsx(Description, {}),
29166
- children,
29167
- /* @__PURE__ */ jsxRuntimeExports.jsx(Close, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
29168
- "img",
29169
- {
29170
- src: closeIcon,
29171
- alt: "close",
29172
- className: "absolute right-2.5 top-2.5 size-6 cursor-pointer"
29173
- }
29174
- ) })
29175
- ]
29176
- }
29177
- )
29178
- ] }) });
29153
+ const WrapModal = ({
29154
+ open,
29155
+ className,
29156
+ disableClose = false,
29157
+ onClose,
29158
+ children
29159
+ }) => {
29160
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
29161
+ Root$1,
29162
+ {
29163
+ open,
29164
+ onOpenChange: (nextOpen) => {
29165
+ if (!nextOpen && disableClose) return;
29166
+ onClose();
29167
+ },
29168
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Portal, { children: [
29169
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { className: "fixed inset-0 bg-black/30 data-[state=open]:animate-overlayShow" }),
29170
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
29171
+ Content,
29172
+ {
29173
+ className: twMerge(
29174
+ "fixed left-1/2 top-1/2 max-h-[95vh] overflow-y-auto -translate-x-1/2 -translate-y-1/2 rounded-2xl bg-white p-10 shadow-md focus:outline-none data-[state=open]:animate-contentShow",
29175
+ className
29176
+ ),
29177
+ children: [
29178
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Title, {}),
29179
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Description, {}),
29180
+ children,
29181
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Close, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
29182
+ "img",
29183
+ {
29184
+ src: closeIcon,
29185
+ alt: "close",
29186
+ className: `absolute right-2.5 top-2.5 size-6 cursor-pointer ${disableClose ? "opacity-50 cursor-not-allowed" : ""}`
29187
+ }
29188
+ ) })
29189
+ ]
29190
+ }
29191
+ )
29192
+ ] })
29193
+ }
29194
+ );
29179
29195
  };
29180
29196
  const ConfirmModal = ({
29181
29197
  disable,
@@ -29187,7 +29203,7 @@ const ConfirmModal = ({
29187
29203
  onConfirm,
29188
29204
  onCancel
29189
29205
  }) => {
29190
- return /* @__PURE__ */ jsxRuntimeExports.jsx(WrapModal, { open, onClose, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col w-full gap-8 max-w-[600px]", children: [
29206
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WrapModal, { open, onClose, disableClose: disable, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col w-full gap-8 max-w-[600px]", children: [
29191
29207
  children,
29192
29208
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4 w-full", children: [
29193
29209
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -29249,6 +29265,7 @@ const createProductsService = {
29249
29265
  );
29250
29266
  })
29251
29267
  };
29268
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
29252
29269
  const CreateProductConfirmModal = ({
29253
29270
  checkedProducts,
29254
29271
  numCheckedProducts,
@@ -29262,20 +29279,21 @@ const CreateProductConfirmModal = ({
29262
29279
  const handleCreateProducts = () => __async(void 0, null, function* () {
29263
29280
  setLoading(true);
29264
29281
  const formattedProducts = checkedProducts.map((product) => {
29265
- var _a;
29266
- return {
29282
+ var _a, _b;
29283
+ return __spreadValues({
29267
29284
  code: product.code,
29268
29285
  name: product.name,
29269
- price: (_a = product.priceBeforeTax) != null ? _a : 0,
29286
+ price: taxDeductionMethod === "direct" ? product.priceAfterTax : (_a = product.priceBeforeTax) != null ? _a : 0,
29270
29287
  img: product.img || "",
29271
29288
  unit: product.unit,
29272
29289
  cost: 0,
29273
- tax: taxDeductionMethod == "direct" ? 0 : product.tax,
29290
+ tax: taxDeductionMethod === "direct" ? 0 : product.tax,
29274
29291
  status: 0,
29275
29292
  category_names: product.category
29276
- };
29293
+ }, taxDeductionMethod === "credit" ? { price_after_vat: (_b = product.priceAfterTax) != null ? _b : 0 } : {});
29277
29294
  });
29278
29295
  try {
29296
+ yield sleep(5e3);
29279
29297
  const response = yield createProductsService.createProducts(
29280
29298
  formattedProducts
29281
29299
  );
@@ -57782,7 +57800,7 @@ const ProductPreviewTable = ({
57782
57800
  width: "200px",
57783
57801
  minWidth: "200px",
57784
57802
  render: ({ tax }) => {
57785
- if (tax == "" || tax === null || tax === void 0) {
57803
+ if (tax === "" || tax === null || tax === void 0) {
57786
57804
  return "";
57787
57805
  }
57788
57806
  const taxNumber = Number(tax);