mozrest-sdk-react-dev 0.2.52 → 0.2.53
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 +210 -135
- package/package.json +1 -1
- package/style.css +2 -2
package/mozrest-sdk.es.js
CHANGED
|
@@ -102403,33 +102403,33 @@ const ReservationsAnalytics = ({ userEmail, userFullName }) => {
|
|
|
102403
102403
|
totalDays
|
|
102404
102404
|
}));
|
|
102405
102405
|
};
|
|
102406
|
-
const mainConatiner = "
|
|
102407
|
-
const mainTableContainer = "
|
|
102408
|
-
const mainSidebarContainer = "
|
|
102409
|
-
const headerContainer = "
|
|
102410
|
-
const buttonList = "
|
|
102411
|
-
const tableTopHeader = "
|
|
102412
|
-
const tableTopHeaderContent = "
|
|
102413
|
-
const tableRowContainer = "
|
|
102414
|
-
const tableRowCard = "
|
|
102415
|
-
const tableRowHour = "
|
|
102416
|
-
const hours = "
|
|
102417
|
-
const tableRowContent = "
|
|
102418
|
-
const rowImage = "
|
|
102419
|
-
const rowContactContainer = "
|
|
102420
|
-
const rowContactText = "
|
|
102421
|
-
const rowContactPhone = "
|
|
102422
|
-
const rowSectionContainer = "
|
|
102423
|
-
const rowSectionText = "
|
|
102424
|
-
const rowSectionSecText = "
|
|
102425
|
-
const rowActionButton = "
|
|
102426
|
-
const bookingInfoContainer = "
|
|
102427
|
-
const bookingInfoCardRow = "
|
|
102428
|
-
const bookingInfoCardContainer = "
|
|
102429
|
-
const bookingInfoCard = "
|
|
102430
|
-
const bookingInfoCardContent = "
|
|
102431
|
-
const bookingInfoCardTitle = "
|
|
102432
|
-
const bookingInfoCardText = "
|
|
102406
|
+
const mainConatiner = "_mainConatiner_twygm_42";
|
|
102407
|
+
const mainTableContainer = "_mainTableContainer_twygm_52";
|
|
102408
|
+
const mainSidebarContainer = "_mainSidebarContainer_twygm_59";
|
|
102409
|
+
const headerContainer = "_headerContainer_twygm_68";
|
|
102410
|
+
const buttonList = "_buttonList_twygm_73";
|
|
102411
|
+
const tableTopHeader = "_tableTopHeader_twygm_79";
|
|
102412
|
+
const tableTopHeaderContent = "_tableTopHeaderContent_twygm_87";
|
|
102413
|
+
const tableRowContainer = "_tableRowContainer_twygm_95";
|
|
102414
|
+
const tableRowCard = "_tableRowCard_twygm_101";
|
|
102415
|
+
const tableRowHour = "_tableRowHour_twygm_105";
|
|
102416
|
+
const hours = "_hours_twygm_116";
|
|
102417
|
+
const tableRowContent = "_tableRowContent_twygm_122";
|
|
102418
|
+
const rowImage = "_rowImage_twygm_129";
|
|
102419
|
+
const rowContactContainer = "_rowContactContainer_twygm_135";
|
|
102420
|
+
const rowContactText = "_rowContactText_twygm_141";
|
|
102421
|
+
const rowContactPhone = "_rowContactPhone_twygm_147";
|
|
102422
|
+
const rowSectionContainer = "_rowSectionContainer_twygm_154";
|
|
102423
|
+
const rowSectionText = "_rowSectionText_twygm_160";
|
|
102424
|
+
const rowSectionSecText = "_rowSectionSecText_twygm_166";
|
|
102425
|
+
const rowActionButton = "_rowActionButton_twygm_173";
|
|
102426
|
+
const bookingInfoContainer = "_bookingInfoContainer_twygm_179";
|
|
102427
|
+
const bookingInfoCardRow = "_bookingInfoCardRow_twygm_183";
|
|
102428
|
+
const bookingInfoCardContainer = "_bookingInfoCardContainer_twygm_191";
|
|
102429
|
+
const bookingInfoCard = "_bookingInfoCard_twygm_183";
|
|
102430
|
+
const bookingInfoCardContent = "_bookingInfoCardContent_twygm_203";
|
|
102431
|
+
const bookingInfoCardTitle = "_bookingInfoCardTitle_twygm_209";
|
|
102432
|
+
const bookingInfoCardText = "_bookingInfoCardText_twygm_212";
|
|
102433
102433
|
var styles$b = {
|
|
102434
102434
|
mainConatiner,
|
|
102435
102435
|
mainTableContainer,
|
|
@@ -102459,6 +102459,43 @@ var styles$b = {
|
|
|
102459
102459
|
bookingInfoCardTitle,
|
|
102460
102460
|
bookingInfoCardText
|
|
102461
102461
|
};
|
|
102462
|
+
const TrashX = () => /* @__PURE__ */ React.createElement("svg", {
|
|
102463
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
102464
|
+
width: "24",
|
|
102465
|
+
height: "24",
|
|
102466
|
+
viewBox: "0 0 24 24"
|
|
102467
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
102468
|
+
width: "24",
|
|
102469
|
+
height: "24",
|
|
102470
|
+
fill: "none"
|
|
102471
|
+
}), /* @__PURE__ */ React.createElement("path", {
|
|
102472
|
+
fill: "none",
|
|
102473
|
+
stroke: "currentColor",
|
|
102474
|
+
"stroke-linecap": "round",
|
|
102475
|
+
"stroke-linejoin": "round",
|
|
102476
|
+
"stroke-width": "2",
|
|
102477
|
+
d: "M4 7h16M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3m-5 5l4 4m0-4l-4 4"
|
|
102478
|
+
}));
|
|
102479
|
+
const EyeOff = () => /* @__PURE__ */ React.createElement("svg", {
|
|
102480
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
102481
|
+
width: "24",
|
|
102482
|
+
height: "24",
|
|
102483
|
+
viewBox: "0 0 24 24"
|
|
102484
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
102485
|
+
width: "24",
|
|
102486
|
+
height: "24",
|
|
102487
|
+
fill: "none"
|
|
102488
|
+
}), /* @__PURE__ */ React.createElement("g", {
|
|
102489
|
+
fill: "none",
|
|
102490
|
+
stroke: "currentColor",
|
|
102491
|
+
"stroke-linecap": "round",
|
|
102492
|
+
"stroke-linejoin": "round",
|
|
102493
|
+
"stroke-width": "2"
|
|
102494
|
+
}, /* @__PURE__ */ React.createElement("path", {
|
|
102495
|
+
d: "M10.585 10.587a2 2 0 0 0 2.829 2.828"
|
|
102496
|
+
}), /* @__PURE__ */ React.createElement("path", {
|
|
102497
|
+
d: "M16.681 16.673A8.7 8.7 0 0 1 12 18q-5.4 0-9-6q1.908-3.18 4.32-4.674m2.86-1.146A9 9 0 0 1 12 6q5.4 0 9 6q-1 1.665-2.138 2.87M3 3l18 18"
|
|
102498
|
+
})));
|
|
102462
102499
|
const CalendarTime = () => /* @__PURE__ */ React.createElement("svg", {
|
|
102463
102500
|
xmlns: "http://www.w3.org/2000/svg",
|
|
102464
102501
|
width: "24",
|
|
@@ -103798,6 +103835,8 @@ const clock = () => {
|
|
|
103798
103835
|
};
|
|
103799
103836
|
var icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
103800
103837
|
__proto__: null,
|
|
103838
|
+
TrashX,
|
|
103839
|
+
EyeOff,
|
|
103801
103840
|
CalendarTime,
|
|
103802
103841
|
CheckBox,
|
|
103803
103842
|
FidgetSpinner,
|
|
@@ -103895,25 +103934,26 @@ const Icon = ({
|
|
|
103895
103934
|
...props
|
|
103896
103935
|
}, React__default.createElement(icons[icon2]));
|
|
103897
103936
|
};
|
|
103898
|
-
const btn = "
|
|
103937
|
+
const btn = "_btn_1s4ho_1";
|
|
103899
103938
|
var styles$9 = {
|
|
103900
103939
|
btn,
|
|
103901
|
-
"btn--large": "_btn--
|
|
103902
|
-
"btn--default": "_btn--
|
|
103903
|
-
"btn--small": "_btn--
|
|
103904
|
-
"btn--mini": "_btn--
|
|
103905
|
-
"btn--primary": "_btn--
|
|
103906
|
-
"btn--secondary": "_btn--
|
|
103907
|
-
"btn--tertiary": "_btn--
|
|
103908
|
-
"btn--inverted": "_btn--
|
|
103909
|
-
"btn--danger": "_btn--
|
|
103910
|
-
"btn--success": "_btn--
|
|
103940
|
+
"btn--large": "_btn--large_1s4ho_16",
|
|
103941
|
+
"btn--default": "_btn--default_1s4ho_20",
|
|
103942
|
+
"btn--small": "_btn--small_1s4ho_24",
|
|
103943
|
+
"btn--mini": "_btn--mini_1s4ho_28",
|
|
103944
|
+
"btn--primary": "_btn--primary_1s4ho_32",
|
|
103945
|
+
"btn--secondary": "_btn--secondary_1s4ho_39",
|
|
103946
|
+
"btn--tertiary": "_btn--tertiary_1s4ho_47",
|
|
103947
|
+
"btn--inverted": "_btn--inverted_1s4ho_55",
|
|
103948
|
+
"btn--danger": "_btn--danger_1s4ho_64",
|
|
103949
|
+
"btn--success": "_btn--success_1s4ho_72"
|
|
103911
103950
|
};
|
|
103912
103951
|
const Button = ({
|
|
103913
103952
|
mode = "primary",
|
|
103914
103953
|
size = "default",
|
|
103915
103954
|
children,
|
|
103916
103955
|
icon: icon2,
|
|
103956
|
+
iconPosition = "left",
|
|
103917
103957
|
isLoading,
|
|
103918
103958
|
className,
|
|
103919
103959
|
disabled: disabled2,
|
|
@@ -103941,7 +103981,7 @@ const Button = ({
|
|
|
103941
103981
|
disabled: isLoading || disabled2,
|
|
103942
103982
|
type: type4
|
|
103943
103983
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
103944
|
-
style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 5 }
|
|
103984
|
+
style: { display: "flex", flexDirection: iconPosition == "left" ? "row" : "row-reverse", alignItems: "center", justifyContent: "center", gap: 5 }
|
|
103945
103985
|
}, IconBtn, isLoading ? "Loading ..." : children));
|
|
103946
103986
|
};
|
|
103947
103987
|
var isCheckBoxInput = (element) => element.type === "checkbox";
|
|
@@ -105607,11 +105647,11 @@ const SrOnly = ({ children }) => {
|
|
|
105607
105647
|
className: styles$7.sronly
|
|
105608
105648
|
}, children);
|
|
105609
105649
|
};
|
|
105610
|
-
const label = "
|
|
105650
|
+
const label = "_label_180ef_1";
|
|
105611
105651
|
var styles$6 = {
|
|
105612
105652
|
label,
|
|
105613
|
-
"label--hidden": "_label--
|
|
105614
|
-
"label--bold": "_label--
|
|
105653
|
+
"label--hidden": "_label--hidden_180ef_8",
|
|
105654
|
+
"label--bold": "_label--bold_180ef_12"
|
|
105615
105655
|
};
|
|
105616
105656
|
const tooltipContainer = "_tooltipContainer_13ux5_1";
|
|
105617
105657
|
const tooltipBox = "_tooltipBox_13ux5_5";
|
|
@@ -105661,19 +105701,22 @@ const Label = ({
|
|
|
105661
105701
|
}, tooltip2));
|
|
105662
105702
|
return isHidden2 ? /* @__PURE__ */ React__default.createElement(SrOnly, null, label2) : label2;
|
|
105663
105703
|
};
|
|
105664
|
-
const inputWrapper = "
|
|
105665
|
-
const input$1 = "
|
|
105666
|
-
const inputIcon = "
|
|
105704
|
+
const inputWrapper = "_inputWrapper_zpxow_1";
|
|
105705
|
+
const input$1 = "_input_zpxow_1";
|
|
105706
|
+
const inputIcon = "_inputIcon_zpxow_74";
|
|
105667
105707
|
var styles$4 = {
|
|
105668
105708
|
inputWrapper,
|
|
105669
105709
|
input: input$1,
|
|
105670
|
-
"input--r-md": "_input--r-
|
|
105671
|
-
"input--r-sm": "_input--r-
|
|
105672
|
-
"input--with-icon-left": "_input--with-icon-
|
|
105673
|
-
"input--with-icon-right": "_input--with-icon-
|
|
105710
|
+
"input--r-md": "_input--r-md_zpxow_36",
|
|
105711
|
+
"input--r-sm": "_input--r-sm_zpxow_41",
|
|
105712
|
+
"input--with-icon-left": "_input--with-icon-left_zpxow_46",
|
|
105713
|
+
"input--with-icon-right": "_input--with-icon-right_zpxow_49",
|
|
105714
|
+
"input--filled": "_input--filled_zpxow_52",
|
|
105715
|
+
"input--borderless": "_input--borderless_zpxow_55",
|
|
105716
|
+
"input--rounded": "_input--rounded_zpxow_59",
|
|
105674
105717
|
inputIcon,
|
|
105675
|
-
"inputIcon--p-left": "_inputIcon--p-
|
|
105676
|
-
"inputIcon--p-right": "_inputIcon--p-
|
|
105718
|
+
"inputIcon--p-left": "_inputIcon--p-left_zpxow_83",
|
|
105719
|
+
"inputIcon--p-right": "_inputIcon--p-right_zpxow_86"
|
|
105677
105720
|
};
|
|
105678
105721
|
const Input2 = ({
|
|
105679
105722
|
id: id2,
|
|
@@ -105691,16 +105734,12 @@ const Input2 = ({
|
|
|
105691
105734
|
tooltip: tooltip2 = "",
|
|
105692
105735
|
disabledTooltip = "",
|
|
105693
105736
|
disabled: disabled2,
|
|
105737
|
+
filled = false,
|
|
105738
|
+
borderLess = false,
|
|
105739
|
+
rounded = false,
|
|
105740
|
+
customStyles: customStyles2,
|
|
105694
105741
|
...props
|
|
105695
105742
|
}) => {
|
|
105696
|
-
const [internalvalue, setInternalValue] = useState(value2);
|
|
105697
|
-
useEffect(() => {
|
|
105698
|
-
setInternalValue(value2);
|
|
105699
|
-
}, [value2]);
|
|
105700
|
-
function handleChange(ev) {
|
|
105701
|
-
setInternalValue(ev.target.value);
|
|
105702
|
-
onChange3 && onChange3(ev);
|
|
105703
|
-
}
|
|
105704
105743
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
105705
105744
|
style: { display: "flex", flexDirection: "column", justifyContent: "start", textAlign: "left" }
|
|
105706
105745
|
}, /* @__PURE__ */ React__default.createElement(Label, {
|
|
@@ -105714,12 +105753,16 @@ const Input2 = ({
|
|
|
105714
105753
|
styles$4["input"],
|
|
105715
105754
|
styles$4[`input--h-${heigth}`],
|
|
105716
105755
|
styles$4[`input--r-${radius}`],
|
|
105717
|
-
icon2 && styles$4[`input--with-icon-${iconPosition}`]
|
|
105756
|
+
icon2 && styles$4[`input--with-icon-${iconPosition}`],
|
|
105757
|
+
filled == true ? styles$4[`input--filled`] : "",
|
|
105758
|
+
borderLess == true ? styles$4[`input--borderless`] : "",
|
|
105759
|
+
rounded == true ? styles$4[`input--rounded`] : ""
|
|
105718
105760
|
),
|
|
105719
|
-
|
|
105761
|
+
style: customStyles2,
|
|
105762
|
+
onChange: onChange3,
|
|
105720
105763
|
id: id2,
|
|
105721
105764
|
name: id2,
|
|
105722
|
-
value:
|
|
105765
|
+
value: value2,
|
|
105723
105766
|
type: type4,
|
|
105724
105767
|
required: required4,
|
|
105725
105768
|
disabled: disabled2,
|
|
@@ -105743,7 +105786,7 @@ const TextInputField = ({ control, name, ...props }) => {
|
|
|
105743
105786
|
fieldState: { error: error3 }
|
|
105744
105787
|
}) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Input2, {
|
|
105745
105788
|
name,
|
|
105746
|
-
value: value2,
|
|
105789
|
+
value: value2 || "",
|
|
105747
105790
|
onChange: (e3) => {
|
|
105748
105791
|
onChange3(e3);
|
|
105749
105792
|
},
|
|
@@ -105871,7 +105914,11 @@ const index$2 = ({ filters: filters2, setFilters }) => {
|
|
|
105871
105914
|
icon: "search",
|
|
105872
105915
|
iconPosition: "left",
|
|
105873
105916
|
iconSize: "small",
|
|
105874
|
-
radius: "md"
|
|
105917
|
+
radius: "md",
|
|
105918
|
+
filled: true,
|
|
105919
|
+
borderLess: true,
|
|
105920
|
+
rounded: true,
|
|
105921
|
+
customStyles: { backgroundColor: "#2F3349" }
|
|
105875
105922
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
105876
105923
|
className: styles$b.buttonList
|
|
105877
105924
|
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
@@ -106033,19 +106080,50 @@ var styles$3 = {
|
|
|
106033
106080
|
tooltip
|
|
106034
106081
|
};
|
|
106035
106082
|
const customStyles = {
|
|
106036
|
-
control: (provided) => ({
|
|
106083
|
+
control: (provided, state) => ({
|
|
106037
106084
|
...provided,
|
|
106038
|
-
|
|
106039
|
-
|
|
106085
|
+
backgroundColor: "transparent",
|
|
106086
|
+
border: "none",
|
|
106087
|
+
borderBottom: `1px solid ${state.isFocused ? "gray" : "#bbb"}`,
|
|
106088
|
+
borderRadius: 0,
|
|
106089
|
+
boxShadow: state.isFocused ? "0 0 5px gray" : "none",
|
|
106090
|
+
color: "#bbb",
|
|
106091
|
+
padding: "4px 0"
|
|
106040
106092
|
}),
|
|
106041
|
-
|
|
106042
|
-
|
|
106043
|
-
|
|
106044
|
-
|
|
106045
|
-
|
|
106046
|
-
|
|
106047
|
-
|
|
106048
|
-
}
|
|
106093
|
+
singleValue: (provided) => ({
|
|
106094
|
+
...provided,
|
|
106095
|
+
color: "#fff"
|
|
106096
|
+
}),
|
|
106097
|
+
input: (provided) => ({
|
|
106098
|
+
...provided,
|
|
106099
|
+
color: "#bbb"
|
|
106100
|
+
}),
|
|
106101
|
+
placeholder: (provided) => ({
|
|
106102
|
+
...provided,
|
|
106103
|
+
color: "#bbb",
|
|
106104
|
+
opacity: 1
|
|
106105
|
+
}),
|
|
106106
|
+
dropdownIndicator: (provided, state) => ({
|
|
106107
|
+
...provided,
|
|
106108
|
+
color: state.isFocused ? "gray" : "#bbb"
|
|
106109
|
+
}),
|
|
106110
|
+
indicatorsContainer: (provided) => ({
|
|
106111
|
+
...provided,
|
|
106112
|
+
backgroundColor: "transparent"
|
|
106113
|
+
}),
|
|
106114
|
+
menu: (provided) => ({
|
|
106115
|
+
...provided,
|
|
106116
|
+
backgroundColor: "#25293C",
|
|
106117
|
+
borderRadius: "4px",
|
|
106118
|
+
marginTop: "4px",
|
|
106119
|
+
color: "#bbb"
|
|
106120
|
+
}),
|
|
106121
|
+
option: (provided, state) => ({
|
|
106122
|
+
...provided,
|
|
106123
|
+
backgroundColor: state.isFocused ? "#393D54" : "#25293C",
|
|
106124
|
+
color: state.isFocused ? "#fff" : "#bbb",
|
|
106125
|
+
cursor: "pointer"
|
|
106126
|
+
})
|
|
106049
106127
|
};
|
|
106050
106128
|
const Select = ({
|
|
106051
106129
|
id: id2 = "",
|
|
@@ -106080,9 +106158,7 @@ const SelectField = ({ control, name, ...props }) => {
|
|
|
106080
106158
|
}) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Select, {
|
|
106081
106159
|
name,
|
|
106082
106160
|
value: value2,
|
|
106083
|
-
onChange:
|
|
106084
|
-
onChange3(e3);
|
|
106085
|
-
},
|
|
106161
|
+
onChange: onChange3,
|
|
106086
106162
|
onBlur: onBlur2,
|
|
106087
106163
|
...props
|
|
106088
106164
|
}), error3 && /* @__PURE__ */ React__default.createElement(FieldError, {
|
|
@@ -106090,7 +106166,7 @@ const SelectField = ({ control, name, ...props }) => {
|
|
|
106090
106166
|
}))
|
|
106091
106167
|
});
|
|
106092
106168
|
};
|
|
106093
|
-
const input = "
|
|
106169
|
+
const input = "_input_zx6p9_1";
|
|
106094
106170
|
var styles$2 = {
|
|
106095
106171
|
input
|
|
106096
106172
|
};
|
|
@@ -106163,12 +106239,18 @@ const ActionButtons = ({ onSubmit }) => {
|
|
|
106163
106239
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
106164
106240
|
style: { display: "flex", gap: 10, justifyContent: selectedBooking ? "center" : "flex-end", alignItems: "center" }
|
|
106165
106241
|
}, selectedBooking && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Button, {
|
|
106166
|
-
mode: "danger"
|
|
106167
|
-
|
|
106242
|
+
mode: "danger",
|
|
106243
|
+
icon: "TrashX",
|
|
106244
|
+
iconPosition: "right"
|
|
106245
|
+
}, t2("CANCEL")), /* @__PURE__ */ React__default.createElement(Button, {
|
|
106246
|
+
icon: "EyeOff",
|
|
106247
|
+
iconPosition: "right"
|
|
106248
|
+
}, t2("NOSHOW"))), /* @__PURE__ */ React__default.createElement(Button, {
|
|
106168
106249
|
mode: "success",
|
|
106169
106250
|
type: "submit",
|
|
106170
106251
|
icon: "check",
|
|
106171
|
-
onClick: () => onSubmit()
|
|
106252
|
+
onClick: () => onSubmit(),
|
|
106253
|
+
iconPosition: "right"
|
|
106172
106254
|
}, selectedBooking ? t2("UPDATE") : t2("CREATE")));
|
|
106173
106255
|
};
|
|
106174
106256
|
const BookingInfoCard = ({ icon: icon2 }) => {
|
|
@@ -106233,7 +106315,7 @@ const Header = () => {
|
|
|
106233
106315
|
const { t: t2 } = useTranslation();
|
|
106234
106316
|
const { selectedBooking } = useSelectedBookingContext();
|
|
106235
106317
|
return /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("h3", null, t2(selectedBooking ? "UPDATERESERVATION" : "ADDRESERVATION")), /* @__PURE__ */ React__default.createElement("hr", {
|
|
106236
|
-
style: { width: "100%" }
|
|
106318
|
+
style: { width: "100%", marginTop: 15 }
|
|
106237
106319
|
}));
|
|
106238
106320
|
};
|
|
106239
106321
|
const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
@@ -106242,14 +106324,14 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106242
106324
|
const [currentTimeZone, setCurrentTimeZone] = useState("");
|
|
106243
106325
|
const [partySizeOptions2, setPartySizeOptions] = useState([]);
|
|
106244
106326
|
const [sourceOptions, setSourceOptions] = useState([]);
|
|
106245
|
-
const [
|
|
106327
|
+
const [timeByDayOptions, setTimeByDayOptions] = useState([]);
|
|
106328
|
+
const [timeOptions, setTimeOptions] = useState([]);
|
|
106246
106329
|
const [tableOptions, setTableOptions] = useState([]);
|
|
106247
106330
|
const defaultValue = {
|
|
106248
106331
|
source: { value: "reservation", label: "Reservation" },
|
|
106249
106332
|
date: "",
|
|
106250
|
-
time:
|
|
106333
|
+
time: null,
|
|
106251
106334
|
partySize: null,
|
|
106252
|
-
area: { value: null, label: "All" },
|
|
106253
106335
|
areaName: "",
|
|
106254
106336
|
table: { value: null, label: "All" },
|
|
106255
106337
|
firstName: "",
|
|
@@ -106265,7 +106347,11 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106265
106347
|
(value2) => value2 !== null && typeof value2 === "object" && !!value2.value
|
|
106266
106348
|
).required(),
|
|
106267
106349
|
date: create$2().required(),
|
|
106268
|
-
time: create$
|
|
106350
|
+
time: create$4().test(
|
|
106351
|
+
"is-valid-time",
|
|
106352
|
+
"Time is required",
|
|
106353
|
+
(value2) => value2 !== null && typeof value2 === "object" && !!value2.value
|
|
106354
|
+
).required(),
|
|
106269
106355
|
partySize: create$4().test(
|
|
106270
106356
|
"is-valid-partySize",
|
|
106271
106357
|
"Party Size is required",
|
|
@@ -106315,16 +106401,12 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106315
106401
|
control,
|
|
106316
106402
|
name: "partySize"
|
|
106317
106403
|
});
|
|
106318
|
-
const table2 = useWatch({
|
|
106319
|
-
control,
|
|
106320
|
-
name: "table"
|
|
106321
|
-
});
|
|
106322
106404
|
const { data: data2, reload, isLoading } = useFetch(
|
|
106323
|
-
source2 && (source2 == null ? void 0 : source2.value) && date4 && time2 && partySize && (partySize == null ? void 0 : partySize.value) ? source2.value == "reservation" ? GetTableAvailability : GetTableWalkInAvailability : () => Promise.resolve([]),
|
|
106405
|
+
source2 && (source2 == null ? void 0 : source2.value) && date4 && time2 && (time2 == null ? void 0 : time2.value) && partySize && (partySize == null ? void 0 : partySize.value) ? source2.value == "reservation" ? GetTableAvailability : GetTableWalkInAvailability : () => Promise.resolve([]),
|
|
106324
106406
|
{
|
|
106325
106407
|
cacheId: "reservation0dashboard0table0availability",
|
|
106326
106408
|
venue_id: venueId,
|
|
106327
|
-
params: source2 && (source2 == null ? void 0 : source2.value) ? { startSec: moment$1.tz(`${date4} ${time2}`, currentTimeZone ? currentTimeZone : "").valueOf() / 1e3, partySize: partySize == null ? void 0 : partySize.value } : {}
|
|
106409
|
+
params: source2 && (source2 == null ? void 0 : source2.value) ? { startSec: moment$1.tz(`${date4} ${time2 == null ? void 0 : time2.value}`, currentTimeZone ? currentTimeZone : "").valueOf() / 1e3, partySize: partySize == null ? void 0 : partySize.value } : {}
|
|
106328
106410
|
}
|
|
106329
106411
|
);
|
|
106330
106412
|
const { execute: executeCreate, data: responBookingCreate, isExecuting: loadingCreate } = useService(AddBooking);
|
|
@@ -106334,13 +106416,13 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106334
106416
|
}
|
|
106335
106417
|
});
|
|
106336
106418
|
const onSubmit = async () => {
|
|
106337
|
-
var _a2, _b, _c;
|
|
106419
|
+
var _a2, _b, _c, _d;
|
|
106338
106420
|
const data22 = await getValues();
|
|
106339
106421
|
if (!selectedBooking) {
|
|
106340
106422
|
const toSend = {
|
|
106341
106423
|
partySize: (_a2 = data22 == null ? void 0 : data22.partySize) == null ? void 0 : _a2.value,
|
|
106342
106424
|
table: (_b = data22 == null ? void 0 : data22.table) == null ? void 0 : _b.value,
|
|
106343
|
-
date: data22.date ? moment$1.tz(`${data22.date} ${data22.time}`, currentTimeZone ? currentTimeZone : "").valueOf() / 1e3 : moment$1.tz(moment$1(), currentTimeZone ? currentTimeZone : "").valueOf() / 1e3,
|
|
106425
|
+
date: data22.date ? moment$1.tz(`${data22.date} ${(_c = data22.time) == null ? void 0 : _c.value}`, currentTimeZone ? currentTimeZone : "").valueOf() / 1e3 : moment$1.tz(moment$1(), currentTimeZone ? currentTimeZone : "").valueOf() / 1e3,
|
|
106344
106426
|
notes: data22 == null ? void 0 : data22.notes,
|
|
106345
106427
|
contact: {
|
|
106346
106428
|
firstname: data22 == null ? void 0 : data22.firstName,
|
|
@@ -106356,12 +106438,12 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106356
106438
|
});
|
|
106357
106439
|
reloadMainTable();
|
|
106358
106440
|
} else {
|
|
106359
|
-
executeUpdate({ data: { table: (
|
|
106441
|
+
executeUpdate({ data: { table: (_d = data22 == null ? void 0 : data22.table) == null ? void 0 : _d.value }, venueId, bookingId: selectedBooking.id });
|
|
106360
106442
|
}
|
|
106361
106443
|
};
|
|
106362
106444
|
useEffect(() => {
|
|
106363
106445
|
if (data2) {
|
|
106364
|
-
const tableOptions2 =
|
|
106446
|
+
const tableOptions2 = data2.map((item2) => {
|
|
106365
106447
|
var _a2, _b;
|
|
106366
106448
|
return { value: item2.id, label: `${item2.name} ${((_a2 = item2 == null ? void 0 : item2.area) == null ? void 0 : _a2.name) ? "- " + ((_b = item2 == null ? void 0 : item2.area) == null ? void 0 : _b.name) : ""}` };
|
|
106367
106449
|
});
|
|
@@ -106370,7 +106452,7 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106370
106452
|
);
|
|
106371
106453
|
setTableOptions(uniqueTableOptions);
|
|
106372
106454
|
}
|
|
106373
|
-
}, [data2
|
|
106455
|
+
}, [data2]);
|
|
106374
106456
|
useEffect(() => {
|
|
106375
106457
|
if (responBookingCreate === "created") {
|
|
106376
106458
|
setSelectedBooking(null);
|
|
@@ -106384,8 +106466,8 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106384
106466
|
if (filtersData == null ? void 0 : filtersData.sources) {
|
|
106385
106467
|
setSourceOptions(filtersData.sources.map((item2) => ({ value: item2.id, label: item2.label })));
|
|
106386
106468
|
}
|
|
106387
|
-
if (filtersData == null ? void 0 : filtersData.
|
|
106388
|
-
|
|
106469
|
+
if (filtersData == null ? void 0 : filtersData.hours) {
|
|
106470
|
+
setTimeByDayOptions(filtersData == null ? void 0 : filtersData.hours);
|
|
106389
106471
|
}
|
|
106390
106472
|
if ((filtersData == null ? void 0 : filtersData.tables) && !selectedBooking) {
|
|
106391
106473
|
setTableOptions(filtersData.tables.map((item2) => ({ value: item2.id, label: item2.label })));
|
|
@@ -106397,7 +106479,6 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106397
106479
|
useEffect(() => {
|
|
106398
106480
|
var _a2, _b, _c;
|
|
106399
106481
|
if (selectedBooking) {
|
|
106400
|
-
console.log(selectedBooking, "SELECTED BOOKING");
|
|
106401
106482
|
const formattedTime = new Date(selectedBooking.date).toLocaleTimeString([], {
|
|
106402
106483
|
...(filtersData == null ? void 0 : filtersData.timeZone) ? {
|
|
106403
106484
|
timeZone: filtersData == null ? void 0 : filtersData.timeZone
|
|
@@ -106409,7 +106490,7 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106409
106490
|
reset({
|
|
106410
106491
|
source: { value: "reservation", label: "Reservation" },
|
|
106411
106492
|
date: moment$1(selectedBooking.date).format("YYYY-MM-DD"),
|
|
106412
|
-
time: formattedTime,
|
|
106493
|
+
time: { value: formattedTime, label: formattedTime },
|
|
106413
106494
|
partySize: partySizeOptions2.find((item2) => item2.value == selectedBooking.partySize),
|
|
106414
106495
|
areaName: (_a2 = selectedBooking == null ? void 0 : selectedBooking.table) == null ? void 0 : _a2.areaName,
|
|
106415
106496
|
table: { value: (_b = selectedBooking == null ? void 0 : selectedBooking.table) == null ? void 0 : _b.id, label: `${(_c = selectedBooking == null ? void 0 : selectedBooking.table) == null ? void 0 : _c.name}` },
|
|
@@ -106422,8 +106503,17 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106422
106503
|
} else {
|
|
106423
106504
|
reset(defaultValue);
|
|
106424
106505
|
}
|
|
106425
|
-
}, [selectedBooking
|
|
106426
|
-
|
|
106506
|
+
}, [selectedBooking]);
|
|
106507
|
+
useEffect(() => {
|
|
106508
|
+
if (date4) {
|
|
106509
|
+
const weekDay = moment$1(date4).format("dddd").toLocaleLowerCase();
|
|
106510
|
+
const timeSlots = timeByDayOptions.find((item2) => item2.weekday === weekDay);
|
|
106511
|
+
if (timeSlots) {
|
|
106512
|
+
setTimeOptions(timeSlots.hours.map((item2) => ({ value: item2.id, label: item2.label })));
|
|
106513
|
+
}
|
|
106514
|
+
}
|
|
106515
|
+
}, [date4]);
|
|
106516
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
106427
106517
|
style: { display: "flex", flexDirection: "column", gap: 10 },
|
|
106428
106518
|
onSubmit: handleSubmit(onSubmit)
|
|
106429
106519
|
}, /* @__PURE__ */ React__default.createElement(Header, null), !selectedBooking && /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -106449,19 +106539,18 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106449
106539
|
type: "date"
|
|
106450
106540
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
106451
106541
|
style: { width: "50%" }
|
|
106452
|
-
}, /* @__PURE__ */ React__default.createElement(
|
|
106453
|
-
|
|
106542
|
+
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
106543
|
+
isDisabled: selectedBooking,
|
|
106454
106544
|
control,
|
|
106545
|
+
isClearable: true,
|
|
106455
106546
|
id: "time",
|
|
106456
106547
|
name: "time",
|
|
106457
106548
|
label: "Time",
|
|
106458
|
-
|
|
106459
|
-
radius: "md",
|
|
106460
|
-
type: "time"
|
|
106549
|
+
options: timeOptions
|
|
106461
106550
|
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
106462
106551
|
style: { display: "flex", gap: 10 }
|
|
106463
106552
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
106464
|
-
style: { width:
|
|
106553
|
+
style: { width: "50%" }
|
|
106465
106554
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
106466
106555
|
isDisabled: selectedBooking,
|
|
106467
106556
|
control,
|
|
@@ -106470,33 +106559,15 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106470
106559
|
name: "partySize",
|
|
106471
106560
|
label: "Party Size",
|
|
106472
106561
|
options: partySizeOptions2
|
|
106473
|
-
})),
|
|
106562
|
+
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
106474
106563
|
style: { width: "50%" }
|
|
106475
|
-
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
106476
|
-
disabled: selectedBooking,
|
|
106477
|
-
control,
|
|
106478
|
-
id: "areaName",
|
|
106479
|
-
name: "areaName",
|
|
106480
|
-
label: "Area",
|
|
106481
|
-
placeholder: "Area ...",
|
|
106482
|
-
radius: "md"
|
|
106483
|
-
})) : /* @__PURE__ */ React__default.createElement("div", {
|
|
106484
|
-
style: { width: "100%" }
|
|
106485
|
-
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
106486
|
-
control,
|
|
106487
|
-
id: "table",
|
|
106488
|
-
name: "table",
|
|
106489
|
-
label: "Table",
|
|
106490
|
-
options: tableOptions
|
|
106491
|
-
}))), selectedBooking && /* @__PURE__ */ React__default.createElement("div", {
|
|
106492
|
-
style: { width: "100%" }
|
|
106493
106564
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
106494
106565
|
control,
|
|
106495
106566
|
id: "table",
|
|
106496
106567
|
name: "table",
|
|
106497
106568
|
label: "Table",
|
|
106498
106569
|
options: tableOptions
|
|
106499
|
-
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
106570
|
+
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
106500
106571
|
style: { display: "flex", gap: 10 }
|
|
106501
106572
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
106502
106573
|
style: { width: "50%" }
|
|
@@ -106507,7 +106578,8 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106507
106578
|
name: "firstName",
|
|
106508
106579
|
label: "Firstname",
|
|
106509
106580
|
placeholder: "Firstname ...",
|
|
106510
|
-
radius: "md"
|
|
106581
|
+
radius: "md",
|
|
106582
|
+
filled: true
|
|
106511
106583
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
106512
106584
|
style: { width: "50%" }
|
|
106513
106585
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
@@ -106517,7 +106589,8 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106517
106589
|
name: "lastName",
|
|
106518
106590
|
label: "Lastname",
|
|
106519
106591
|
placeholder: "Lastname ...",
|
|
106520
|
-
radius: "md"
|
|
106592
|
+
radius: "md",
|
|
106593
|
+
filled: true
|
|
106521
106594
|
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
106522
106595
|
style: { width: "100%" }
|
|
106523
106596
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
@@ -106527,7 +106600,8 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106527
106600
|
name: "email",
|
|
106528
106601
|
label: "Email",
|
|
106529
106602
|
placeholder: "Email ...",
|
|
106530
|
-
radius: "md"
|
|
106603
|
+
radius: "md",
|
|
106604
|
+
filled: true
|
|
106531
106605
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
106532
106606
|
style: { width: "100%" }
|
|
106533
106607
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
@@ -106537,7 +106611,8 @@ const index = ({ filtersData, venueId, reloadMainTable }) => {
|
|
|
106537
106611
|
name: "phone",
|
|
106538
106612
|
label: "Phone",
|
|
106539
106613
|
placeholder: "Phone ...",
|
|
106540
|
-
radius: "md"
|
|
106614
|
+
radius: "md",
|
|
106615
|
+
filled: true
|
|
106541
106616
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
106542
106617
|
style: { width: "100%" }
|
|
106543
106618
|
}, /* @__PURE__ */ React__default.createElement(TextAreaField, {
|
|
@@ -106577,7 +106652,7 @@ function MainComponent({ venueId }) {
|
|
|
106577
106652
|
const { data: filtersData, isLoading: filtersLoading, error: filtersError, reload: reloadSelectsData } = useFetch(GetCreateBookingSelectsData, {
|
|
106578
106653
|
cacheId: "venueCapacity",
|
|
106579
106654
|
venue_id: venueId,
|
|
106580
|
-
includeAreaInTables:
|
|
106655
|
+
includeAreaInTables: true,
|
|
106581
106656
|
includeCoversInTables: false
|
|
106582
106657
|
});
|
|
106583
106658
|
useEffect(() => {
|