@sawport/react-sdk 0.1.0-alpha.21 → 0.1.0-alpha.22

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/index.js CHANGED
@@ -25356,7 +25356,7 @@ function makeGetter(name) {
25356
25356
  return this.isValid() ? this._data[name] : NaN;
25357
25357
  };
25358
25358
  }
25359
- var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days$1 = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years");
25359
+ var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days$2 = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years");
25360
25360
  function weeks() {
25361
25361
  return absFloor(this.days() / 7);
25362
25362
  }
@@ -25479,7 +25479,7 @@ proto$2.milliseconds = milliseconds;
25479
25479
  proto$2.seconds = seconds;
25480
25480
  proto$2.minutes = minutes;
25481
25481
  proto$2.hours = hours;
25482
- proto$2.days = days$1;
25482
+ proto$2.days = days$2;
25483
25483
  proto$2.weeks = weeks;
25484
25484
  proto$2.months = months;
25485
25485
  proto$2.years = years;
@@ -41763,6 +41763,15 @@ const styles$1 = {
41763
41763
  schActionBtnPending
41764
41764
  };
41765
41765
  const PhoneInput = lib.default || lib;
41766
+ const days$1 = {
41767
+ Monday: 1,
41768
+ Tuesday: 2,
41769
+ Wednesday: 3,
41770
+ Thursday: 4,
41771
+ Friday: 5,
41772
+ Saturday: 6,
41773
+ Sunday: 0
41774
+ };
41766
41775
  const Offline = react.exports.memo(({
41767
41776
  company_id,
41768
41777
  website_name,
@@ -41771,7 +41780,9 @@ const Offline = react.exports.memo(({
41771
41780
  calendar: calendar2,
41772
41781
  hexcode,
41773
41782
  toTime,
41774
- fromTime
41783
+ fromTime,
41784
+ toDay,
41785
+ fromDay
41775
41786
  }) => {
41776
41787
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
41777
41788
  const [ipAddress, setIpAddress] = react.exports.useState("");
@@ -41788,16 +41799,16 @@ const Offline = react.exports.memo(({
41788
41799
  full_name: create$4().required("Your full name is required"),
41789
41800
  email: create$4().email().required(),
41790
41801
  account: create$3().min(5).required("Your account no. is required"),
41791
- date: create$2().required("Please specify a date"),
41792
- time: create$4().min(4).required("Please specify a time").test("time", "Selected time is out of Hours of Operations", function(value2) {
41802
+ date: create$2().min(hooks().subtract(1, "day"), "Please choose future date").required("Please specify a date"),
41803
+ time: create$4().min(4).required("Please specify a time").test("time", "Selected time is out of Hours of Operations", function(value2, {
41804
+ parent: parent2
41805
+ }) {
41793
41806
  const timeformat = "hh:mm:ss";
41807
+ const day = hooks(parent2.date).day();
41808
+ const startDay = days$1[fromDay];
41809
+ const endDay = days$1[toDay];
41794
41810
  const check2 = hooks(value2, timeformat), beforeTime = hooks(fromTime, timeformat), afterTime = hooks(toTime, timeformat);
41795
- const validTime = hooks(check2).isBetween(beforeTime, afterTime);
41796
- if (validTime) {
41797
- return true;
41798
- } else {
41799
- return false;
41800
- }
41811
+ return day >= startDay && day <= endDay && hooks(check2).isBetween(beforeTime, afterTime);
41801
41812
  }),
41802
41813
  reason: create$4().min(1).required("Reason is required")
41803
41814
  });
@@ -47380,7 +47391,9 @@ const WidgetFormDisplay = react.exports.memo(({
47380
47391
  website_name: company == null ? void 0 : company.name,
47381
47392
  setIsScheduling,
47382
47393
  toTime: company == null ? void 0 : company.to_time,
47383
- fromTime: company == null ? void 0 : company.from_time
47394
+ fromTime: company == null ? void 0 : company.from_time,
47395
+ toDay: company == null ? void 0 : company.to_day,
47396
+ fromDay: company == null ? void 0 : company.from_day
47384
47397
  }) : chatInit && !chatClose ? /* @__PURE__ */ jsx(Feedback$1, {
47385
47398
  quickStopChat,
47386
47399
  agent,