mozrest-sdk-react-dev 0.2.73 → 0.2.75
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/mozrest-sdk.es.js +97 -76
- package/package.json +1 -1
- package/style.css +2 -2
package/mozrest-sdk.es.js
CHANGED
|
@@ -7830,7 +7830,7 @@ const fileSad = () => /* @__PURE__ */ React__default.createElement("svg", {
|
|
|
7830
7830
|
strokeLinejoin: "round",
|
|
7831
7831
|
width: "24",
|
|
7832
7832
|
height: "24",
|
|
7833
|
-
strokeWidth: "
|
|
7833
|
+
strokeWidth: "0.5"
|
|
7834
7834
|
}, /* @__PURE__ */ React__default.createElement("path", {
|
|
7835
7835
|
d: "M14 3v4a1 1 0 0 0 1 1h4"
|
|
7836
7836
|
}), /* @__PURE__ */ React__default.createElement("path", {
|
|
@@ -9141,13 +9141,14 @@ var icons$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
9141
9141
|
people: people$1,
|
|
9142
9142
|
clock: clock$1
|
|
9143
9143
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9144
|
-
const icon$7 = "
|
|
9144
|
+
const icon$7 = "_icon_69yub_1";
|
|
9145
9145
|
var styles$21 = {
|
|
9146
9146
|
icon: icon$7,
|
|
9147
|
-
"icon--small": "_icon--
|
|
9148
|
-
"icon--medium": "_icon--
|
|
9149
|
-
"icon--large": "_icon--
|
|
9150
|
-
"icon--xl": "_icon--
|
|
9147
|
+
"icon--small": "_icon--small_69yub_12",
|
|
9148
|
+
"icon--medium": "_icon--medium_69yub_15",
|
|
9149
|
+
"icon--large": "_icon--large_69yub_18",
|
|
9150
|
+
"icon--xl": "_icon--xl_69yub_21",
|
|
9151
|
+
"icon--xxl": "_icon--xxl_69yub_24"
|
|
9151
9152
|
};
|
|
9152
9153
|
const Icon$2 = ({
|
|
9153
9154
|
size = "medium",
|
|
@@ -34980,7 +34981,7 @@ var getBuiltIn$1 = getBuiltIn$5;
|
|
|
34980
34981
|
var inspectSource = inspectSource$2;
|
|
34981
34982
|
var noop$7 = function() {
|
|
34982
34983
|
};
|
|
34983
|
-
var empty$
|
|
34984
|
+
var empty$1 = [];
|
|
34984
34985
|
var construct = getBuiltIn$1("Reflect", "construct");
|
|
34985
34986
|
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
34986
34987
|
var exec = uncurryThis$1(constructorRegExp.exec);
|
|
@@ -34989,7 +34990,7 @@ var isConstructorModern = function isConstructor(argument) {
|
|
|
34989
34990
|
if (!isCallable(argument))
|
|
34990
34991
|
return false;
|
|
34991
34992
|
try {
|
|
34992
|
-
construct(noop$7, empty$
|
|
34993
|
+
construct(noop$7, empty$1, argument);
|
|
34993
34994
|
return true;
|
|
34994
34995
|
} catch (error3) {
|
|
34995
34996
|
return false;
|
|
@@ -39751,10 +39752,9 @@ const Header$4 = ({ title: title2 }) => {
|
|
|
39751
39752
|
className: styles$1K.header
|
|
39752
39753
|
}, /* @__PURE__ */ React__default.createElement(Heading, null, " ", title2));
|
|
39753
39754
|
};
|
|
39754
|
-
|
|
39755
|
-
const
|
|
39756
|
-
const
|
|
39757
|
-
const img = "_img_1br9g_14";
|
|
39755
|
+
const container$D = "_container_1kvyl_1";
|
|
39756
|
+
const icon$5 = "_icon_1kvyl_9";
|
|
39757
|
+
const img = "_img_1kvyl_13";
|
|
39758
39758
|
var styles$1J = {
|
|
39759
39759
|
container: container$D,
|
|
39760
39760
|
icon: icon$5,
|
|
@@ -39763,10 +39763,10 @@ var styles$1J = {
|
|
|
39763
39763
|
const Empty = ({ children }) => {
|
|
39764
39764
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
39765
39765
|
className: styles$1J.container
|
|
39766
|
-
}, /* @__PURE__ */ React__default.createElement(
|
|
39767
|
-
|
|
39768
|
-
className: styles$1J.
|
|
39769
|
-
|
|
39766
|
+
}, /* @__PURE__ */ React__default.createElement(Icon$2, {
|
|
39767
|
+
icon: "fileSad",
|
|
39768
|
+
className: styles$1J.icon,
|
|
39769
|
+
size: "xxl"
|
|
39770
39770
|
}), /* @__PURE__ */ React__default.createElement("h2", null, children));
|
|
39771
39771
|
};
|
|
39772
39772
|
const container$C = "_container_ntfln_1";
|
|
@@ -47552,9 +47552,7 @@ const Input$2 = ({
|
|
|
47552
47552
|
required: required4,
|
|
47553
47553
|
disabled: disabled2,
|
|
47554
47554
|
...props
|
|
47555
|
-
})
|
|
47556
|
-
style: { position: "absolute", top: "1rem", right: "1rem" }
|
|
47557
|
-
}, /* @__PURE__ */ React__default.createElement(LockTooltip, null, disabledTooltip))));
|
|
47555
|
+
})));
|
|
47558
47556
|
};
|
|
47559
47557
|
const TextInputField$1 = (props) => {
|
|
47560
47558
|
const [field2, meta] = useField(props.id);
|
|
@@ -92649,7 +92647,7 @@ const formatChannelsData = (data2) => {
|
|
|
92649
92647
|
return [{ id: null, label: "All" }, ...reservationPortals.map((p2) => ({ id: p2.id, label: p2.name }))];
|
|
92650
92648
|
};
|
|
92651
92649
|
const formatSmartChannelsData = (data2) => {
|
|
92652
|
-
return data2.map((p2) => ({ value: p2.id, label: p2.name }));
|
|
92650
|
+
return data2.map((p2) => ({ value: p2.id, label: p2.name, code: p2.code }));
|
|
92653
92651
|
};
|
|
92654
92652
|
const formatHoursData = (data2) => {
|
|
92655
92653
|
if (!data2 || typeof data2 !== "object") {
|
|
@@ -102518,34 +102516,34 @@ const ReservationsAnalytics = ({ userEmail, userFullName }) => {
|
|
|
102518
102516
|
totalDays
|
|
102519
102517
|
}));
|
|
102520
102518
|
};
|
|
102521
|
-
const mainConatiner$1 = "
|
|
102522
|
-
const mainTableContainer = "
|
|
102523
|
-
const mainSidebarContainer = "
|
|
102524
|
-
const headerContainer = "
|
|
102525
|
-
const buttonList = "
|
|
102526
|
-
const tableTopHeader = "
|
|
102527
|
-
const tableTopHeaderContent = "
|
|
102528
|
-
const tableRowContainer = "
|
|
102529
|
-
const tableRowCard = "
|
|
102530
|
-
const noData = "
|
|
102531
|
-
const tableRowHour = "
|
|
102532
|
-
const hours = "
|
|
102533
|
-
const tableRowContent = "
|
|
102534
|
-
const rowImage = "
|
|
102535
|
-
const rowContactContainer = "
|
|
102536
|
-
const rowContactText = "
|
|
102537
|
-
const rowContactPhone = "
|
|
102538
|
-
const rowSectionContainer = "
|
|
102539
|
-
const rowSectionText = "
|
|
102540
|
-
const rowSectionSecText = "
|
|
102541
|
-
const rowActionButton = "
|
|
102542
|
-
const bookingInfoContainer = "
|
|
102543
|
-
const bookingInfoCardRow = "
|
|
102544
|
-
const bookingInfoCardContainer = "
|
|
102545
|
-
const bookingInfoCard = "
|
|
102546
|
-
const bookingInfoCardContent = "
|
|
102547
|
-
const bookingInfoCardTitle = "
|
|
102548
|
-
const bookingInfoCardText = "
|
|
102519
|
+
const mainConatiner$1 = "_mainConatiner_ek91m_48";
|
|
102520
|
+
const mainTableContainer = "_mainTableContainer_ek91m_58";
|
|
102521
|
+
const mainSidebarContainer = "_mainSidebarContainer_ek91m_65";
|
|
102522
|
+
const headerContainer = "_headerContainer_ek91m_74";
|
|
102523
|
+
const buttonList = "_buttonList_ek91m_79";
|
|
102524
|
+
const tableTopHeader = "_tableTopHeader_ek91m_85";
|
|
102525
|
+
const tableTopHeaderContent = "_tableTopHeaderContent_ek91m_93";
|
|
102526
|
+
const tableRowContainer = "_tableRowContainer_ek91m_101";
|
|
102527
|
+
const tableRowCard = "_tableRowCard_ek91m_107";
|
|
102528
|
+
const noData = "_noData_ek91m_112";
|
|
102529
|
+
const tableRowHour = "_tableRowHour_ek91m_119";
|
|
102530
|
+
const hours = "_hours_ek91m_130";
|
|
102531
|
+
const tableRowContent = "_tableRowContent_ek91m_136";
|
|
102532
|
+
const rowImage = "_rowImage_ek91m_145";
|
|
102533
|
+
const rowContactContainer = "_rowContactContainer_ek91m_151";
|
|
102534
|
+
const rowContactText = "_rowContactText_ek91m_157";
|
|
102535
|
+
const rowContactPhone = "_rowContactPhone_ek91m_163";
|
|
102536
|
+
const rowSectionContainer = "_rowSectionContainer_ek91m_170";
|
|
102537
|
+
const rowSectionText = "_rowSectionText_ek91m_176";
|
|
102538
|
+
const rowSectionSecText = "_rowSectionSecText_ek91m_182";
|
|
102539
|
+
const rowActionButton = "_rowActionButton_ek91m_189";
|
|
102540
|
+
const bookingInfoContainer = "_bookingInfoContainer_ek91m_195";
|
|
102541
|
+
const bookingInfoCardRow = "_bookingInfoCardRow_ek91m_199";
|
|
102542
|
+
const bookingInfoCardContainer = "_bookingInfoCardContainer_ek91m_207";
|
|
102543
|
+
const bookingInfoCard = "_bookingInfoCard_ek91m_199";
|
|
102544
|
+
const bookingInfoCardContent = "_bookingInfoCardContent_ek91m_219";
|
|
102545
|
+
const bookingInfoCardTitle = "_bookingInfoCardTitle_ek91m_225";
|
|
102546
|
+
const bookingInfoCardText = "_bookingInfoCardText_ek91m_228";
|
|
102549
102547
|
var styles$f = {
|
|
102550
102548
|
mainConatiner: mainConatiner$1,
|
|
102551
102549
|
mainTableContainer,
|
|
@@ -106060,22 +106058,22 @@ const Label = ({
|
|
|
106060
106058
|
}, tooltip2));
|
|
106061
106059
|
return isHidden2 ? /* @__PURE__ */ React__default.createElement(SrOnly, null, label2) : label2;
|
|
106062
106060
|
};
|
|
106063
|
-
const inputWrapper = "
|
|
106064
|
-
const input$2 = "
|
|
106065
|
-
const inputIcon = "
|
|
106061
|
+
const inputWrapper = "_inputWrapper_1v87g_1";
|
|
106062
|
+
const input$2 = "_input_1v87g_1";
|
|
106063
|
+
const inputIcon = "_inputIcon_1v87g_73";
|
|
106066
106064
|
var styles$8 = {
|
|
106067
106065
|
inputWrapper,
|
|
106068
106066
|
input: input$2,
|
|
106069
|
-
"input--r-md": "_input--r-
|
|
106070
|
-
"input--r-sm": "_input--r-
|
|
106071
|
-
"input--with-icon-left": "_input--with-icon-
|
|
106072
|
-
"input--with-icon-right": "_input--with-icon-
|
|
106073
|
-
"input--filled": "_input--
|
|
106074
|
-
"input--borderless": "_input--
|
|
106075
|
-
"input--rounded": "_input--
|
|
106067
|
+
"input--r-md": "_input--r-md_1v87g_35",
|
|
106068
|
+
"input--r-sm": "_input--r-sm_1v87g_40",
|
|
106069
|
+
"input--with-icon-left": "_input--with-icon-left_1v87g_45",
|
|
106070
|
+
"input--with-icon-right": "_input--with-icon-right_1v87g_48",
|
|
106071
|
+
"input--filled": "_input--filled_1v87g_51",
|
|
106072
|
+
"input--borderless": "_input--borderless_1v87g_54",
|
|
106073
|
+
"input--rounded": "_input--rounded_1v87g_58",
|
|
106076
106074
|
inputIcon,
|
|
106077
|
-
"inputIcon--p-left": "_inputIcon--p-
|
|
106078
|
-
"inputIcon--p-right": "_inputIcon--p-
|
|
106075
|
+
"inputIcon--p-left": "_inputIcon--p-left_1v87g_82",
|
|
106076
|
+
"inputIcon--p-right": "_inputIcon--p-right_1v87g_85"
|
|
106079
106077
|
};
|
|
106080
106078
|
const Input2 = ({
|
|
106081
106079
|
id: id2,
|
|
@@ -106653,7 +106651,7 @@ var styles$7 = {
|
|
|
106653
106651
|
const customStyles = {
|
|
106654
106652
|
control: (provided, state) => ({
|
|
106655
106653
|
...provided,
|
|
106656
|
-
backgroundColor: "transparent",
|
|
106654
|
+
backgroundColor: state.isDisabled ? "#25293C" : "transparent",
|
|
106657
106655
|
border: "none",
|
|
106658
106656
|
borderBottom: `1px solid ${state.isFocused ? "gray" : "#bbb"}`,
|
|
106659
106657
|
borderRadius: 0,
|
|
@@ -106715,9 +106713,7 @@ const Select = ({
|
|
|
106715
106713
|
...props,
|
|
106716
106714
|
id: id2,
|
|
106717
106715
|
isDisabled
|
|
106718
|
-
})
|
|
106719
|
-
className: styles$7.tooltip
|
|
106720
|
-
}, /* @__PURE__ */ React__default.createElement(LockTooltip, null, disabledTooltip))));
|
|
106716
|
+
})));
|
|
106721
106717
|
};
|
|
106722
106718
|
const SelectField = ({ control, name, ...props }) => {
|
|
106723
106719
|
return /* @__PURE__ */ React__default.createElement(Controller, {
|
|
@@ -106781,9 +106777,7 @@ const TextArea = React__default.forwardRef(
|
|
|
106781
106777
|
disabled: disabled2,
|
|
106782
106778
|
...props,
|
|
106783
106779
|
ref
|
|
106784
|
-
})
|
|
106785
|
-
style: { position: "absolute", top: "1rem", right: "1rem" }
|
|
106786
|
-
}, /* @__PURE__ */ React__default.createElement(LockTooltip, null, disabledTooltip))));
|
|
106780
|
+
})));
|
|
106787
106781
|
}
|
|
106788
106782
|
);
|
|
106789
106783
|
const TextAreaField = ({ control, name, ...props }) => {
|
|
@@ -107017,10 +107011,14 @@ const index$6 = ({ filtersData, venueId }) => {
|
|
|
107017
107011
|
"Table is required",
|
|
107018
107012
|
(value2) => value2 !== null && typeof value2 === "object" && !!value2.value
|
|
107019
107013
|
).required(),
|
|
107020
|
-
firstName: create$2()
|
|
107021
|
-
lastName: create$2()
|
|
107022
|
-
email: create$2().email(t2("errors.email"))
|
|
107023
|
-
phone: create$2().
|
|
107014
|
+
firstName: create$2(),
|
|
107015
|
+
lastName: create$2(),
|
|
107016
|
+
email: create$2().email(t2("errors.email")),
|
|
107017
|
+
phone: create$2().nullable().notRequired().test(
|
|
107018
|
+
"is-valid-phone",
|
|
107019
|
+
t2("errors.phone"),
|
|
107020
|
+
(value2) => !value2 || new RegExp(/^\+?[1-9]\d{8,14}$/).test(value2)
|
|
107021
|
+
),
|
|
107024
107022
|
notes: create$2()
|
|
107025
107023
|
});
|
|
107026
107024
|
const {
|
|
@@ -107028,6 +107026,7 @@ const index$6 = ({ filtersData, venueId }) => {
|
|
|
107028
107026
|
reset,
|
|
107029
107027
|
trigger,
|
|
107030
107028
|
getValues,
|
|
107029
|
+
setValue: setValue2,
|
|
107031
107030
|
handleSubmit
|
|
107032
107031
|
} = useForm({
|
|
107033
107032
|
mode: "onChange",
|
|
@@ -107065,7 +107064,7 @@ const index$6 = ({ filtersData, venueId }) => {
|
|
|
107065
107064
|
}
|
|
107066
107065
|
});
|
|
107067
107066
|
const onSubmit = async () => {
|
|
107068
|
-
var _a2, _b, _c, _d, _e2;
|
|
107067
|
+
var _a2, _b, _c, _d, _e2, _f, _g;
|
|
107069
107068
|
const data22 = await getValues();
|
|
107070
107069
|
const result = await trigger();
|
|
107071
107070
|
if (!result) {
|
|
@@ -107093,7 +107092,12 @@ const index$6 = ({ filtersData, venueId }) => {
|
|
|
107093
107092
|
});
|
|
107094
107093
|
reloadMainTable();
|
|
107095
107094
|
} else {
|
|
107096
|
-
|
|
107095
|
+
const toSend = {
|
|
107096
|
+
partySize: (_e2 = data22 == null ? void 0 : data22.partySize) == null ? void 0 : _e2.value,
|
|
107097
|
+
table: (_f = data22 == null ? void 0 : data22.table) == null ? void 0 : _f.value,
|
|
107098
|
+
date: data22.date ? moment$1.tz(`${data22.date} ${(_g = data22.time) == null ? void 0 : _g.value}`, currentTimeZone ? currentTimeZone : "").valueOf() / 1e3 : moment$1.tz(moment$1(), currentTimeZone ? currentTimeZone : "").valueOf() / 1e3
|
|
107099
|
+
};
|
|
107100
|
+
executeUpdate({ data: toSend, venueId, bookingId: selectedBooking.id });
|
|
107097
107101
|
}
|
|
107098
107102
|
};
|
|
107099
107103
|
useEffect(() => {
|
|
@@ -107167,6 +107171,26 @@ const index$6 = ({ filtersData, venueId }) => {
|
|
|
107167
107171
|
}
|
|
107168
107172
|
}
|
|
107169
107173
|
}, [date4]);
|
|
107174
|
+
useEffect(() => {
|
|
107175
|
+
if (source2 && source2.code === "WALK-IN") {
|
|
107176
|
+
const currentTime = moment$1();
|
|
107177
|
+
setValue2("date", currentTime.format("YYYY-MM-DD"));
|
|
107178
|
+
if (timeOptions.length > 0) {
|
|
107179
|
+
const validFutureTimes = timeOptions.filter((option) => option.value).map((option) => ({
|
|
107180
|
+
...option,
|
|
107181
|
+
momentValue: moment$1(option.value, "HH:mm")
|
|
107182
|
+
})).filter((option) => option.momentValue.isSameOrAfter(currentTime));
|
|
107183
|
+
if (validFutureTimes.length > 0) {
|
|
107184
|
+
const closestTime = validFutureTimes.reduce((prev2, curr) => {
|
|
107185
|
+
const prevDiff = Math.abs(currentTime.diff(prev2.momentValue, "minutes"));
|
|
107186
|
+
const currDiff = Math.abs(currentTime.diff(curr.momentValue, "minutes"));
|
|
107187
|
+
return currDiff < prevDiff ? curr : prev2;
|
|
107188
|
+
});
|
|
107189
|
+
setValue2("time", closestTime);
|
|
107190
|
+
}
|
|
107191
|
+
}
|
|
107192
|
+
}
|
|
107193
|
+
}, [source2, timeOptions, setValue2]);
|
|
107170
107194
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
107171
107195
|
style: { display: "flex", flexDirection: "column", gap: 10 },
|
|
107172
107196
|
onSubmit: handleSubmit(onSubmit)
|
|
@@ -107183,7 +107207,6 @@ const index$6 = ({ filtersData, venueId }) => {
|
|
|
107183
107207
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107184
107208
|
style: { width: "50%" }
|
|
107185
107209
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
107186
|
-
disabled: selectedBooking,
|
|
107187
107210
|
control,
|
|
107188
107211
|
id: "date",
|
|
107189
107212
|
name: "date",
|
|
@@ -107194,7 +107217,6 @@ const index$6 = ({ filtersData, venueId }) => {
|
|
|
107194
107217
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
107195
107218
|
style: { width: "50%" }
|
|
107196
107219
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
107197
|
-
isDisabled: selectedBooking,
|
|
107198
107220
|
control,
|
|
107199
107221
|
isClearable: true,
|
|
107200
107222
|
id: "time",
|
|
@@ -107206,7 +107228,6 @@ const index$6 = ({ filtersData, venueId }) => {
|
|
|
107206
107228
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107207
107229
|
style: { width: "50%" }
|
|
107208
107230
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
107209
|
-
isDisabled: selectedBooking,
|
|
107210
107231
|
control,
|
|
107211
107232
|
isClearable: true,
|
|
107212
107233
|
id: "partySize",
|