@qite/tide-booking-component 1.0.37 → 1.0.39

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.
@@ -8681,7 +8681,7 @@ var OptionItem = function (_a) {
8681
8681
  ? option.isSelected
8682
8682
  ? -option.line.price
8683
8683
  : option.line.price
8684
- : option.requirementType === 2
8684
+ : (option.requirementType === 2 || option.requirementType === 3)
8685
8685
  ? option.line.price - selectedPrice
8686
8686
  : 0;
8687
8687
  var accommodations = lodash.uniqBy(lodash.compact(__spreadArray([option.line], option.alternatives, true).map(function (option) {
@@ -8780,7 +8780,7 @@ var OptionItem = function (_a) {
8780
8780
  "checkbox__input",
8781
8781
  "checkbox__input--parent",
8782
8782
  ]), defaultChecked: option.isSelected, onChange: handleSelectionChange })),
8783
- option.requirementType === 2 && (React__default["default"].createElement("input", { type: "radio", value: index, id: "".concat(parentId, "_").concat(index), name: parentId, className: buildClassName([
8783
+ (option.requirementType === 2 || option.requirementType === 3) && (React__default["default"].createElement("input", { type: "radio", value: index, id: "".concat(parentId, "_").concat(index), name: parentId, className: buildClassName([
8784
8784
  "radiobutton__input",
8785
8785
  "radiobutton__input--parent",
8786
8786
  ]), defaultChecked: option.isSelected, onChange: handleSelectionChange })),
@@ -8827,7 +8827,7 @@ var OptionPaxGroup = function (_a) {
8827
8827
  var updatedGroup = __assign(__assign({}, group), { options: group.options.map(function (o, i) {
8828
8828
  return i === index
8829
8829
  ? option
8830
- : __assign(__assign({}, o), { isSelected: option.requirementType === 2 ? false : o.isSelected });
8830
+ : __assign(__assign({}, o), { isSelected: option.requirementType === 2 || option.requirementType === 3 ? false : o.isSelected });
8831
8831
  }) });
8832
8832
  if (onGroupChange)
8833
8833
  onGroupChange(updatedGroup, paxId, optionId);
@@ -8869,13 +8869,13 @@ var OptionPaxGroup = function (_a) {
8869
8869
  (option.requirementType === 0 ||
8870
8870
  option.requirementType === 1) &&
8871
8871
  "checkbox",
8872
- option.requirementType === 2 && "radiobutton",
8872
+ (option.requirementType === 2 || option.requirementType === 3) && "radiobutton",
8873
8873
  ]) },
8874
8874
  React__default["default"].createElement("label", { htmlFor: "".concat(parentId, "_").concat(index), className: buildClassName([
8875
8875
  (option.requirementType === 0 ||
8876
8876
  option.requirementType === 1) &&
8877
8877
  "checkbox__label",
8878
- option.requirementType === 2 &&
8878
+ (option.requirementType === 2 || option.requirementType === 3) &&
8879
8879
  "radiobutton__label",
8880
8880
  ]) },
8881
8881
  React__default["default"].createElement(OptionItem, { option: option, parentId: parentId, index: index, selectedPrice: selectedPrice, onOptionChange: handleOptionChange }),
@@ -8942,7 +8942,7 @@ var OptionUnitGroup = function (_a) {
8942
8942
  var updatedGroup = __assign(__assign({}, group), { options: group.options.map(function (o, i) {
8943
8943
  return i === index
8944
8944
  ? option
8945
- : __assign(__assign({}, o), { isSelected: option.requirementType === 2 ? false : o.isSelected });
8945
+ : __assign(__assign({}, o), { isSelected: option.requirementType === 2 || option.requirementType === 3 ? false : o.isSelected });
8946
8946
  }) });
8947
8947
  if (onGroupChange)
8948
8948
  onGroupChange(updatedGroup, unitIndex, optionId);
@@ -8991,13 +8991,13 @@ var OptionUnitGroup = function (_a) {
8991
8991
  (option.requirementType === 0 ||
8992
8992
  option.requirementType === 1) &&
8993
8993
  "checkbox",
8994
- option.requirementType === 2 && "radiobutton",
8994
+ (option.requirementType === 2 || option.requirementType === 3) && "radiobutton",
8995
8995
  ]) },
8996
8996
  React__default["default"].createElement("label", { htmlFor: "".concat(parentId, "_").concat(index), className: buildClassName([
8997
8997
  (option.requirementType === 0 ||
8998
8998
  option.requirementType === 1) &&
8999
8999
  "checkbox__label",
9000
- option.requirementType === 2 &&
9000
+ (option.requirementType === 2 || option.requirementType === 3) &&
9001
9001
  "radiobutton__label",
9002
9002
  ]) },
9003
9003
  React__default["default"].createElement(OptionItem, { option: option, parentId: parentId, index: index, selectedPrice: selectedPrice, onOptionChange: handleOptionChange }),
@@ -9058,7 +9058,7 @@ var OptionBookingGroup = function (_a) {
9058
9058
  var updatedGroup = __assign(__assign({}, group), { options: group.options.map(function (o, i) {
9059
9059
  return i === index
9060
9060
  ? option
9061
- : __assign(__assign({}, o), { isSelected: option.requirementType === 2 ? false : o.isSelected });
9061
+ : __assign(__assign({}, o), { isSelected: (option.requirementType === 2 || option.requirementType === 3) ? false : o.isSelected });
9062
9062
  }) });
9063
9063
  if (onGroupChange)
9064
9064
  onGroupChange(updatedGroup, optionId);
@@ -9114,13 +9114,13 @@ var OptionBookingGroup = function (_a) {
9114
9114
  (option.requirementType === 0 ||
9115
9115
  option.requirementType === 1) &&
9116
9116
  "checkbox",
9117
- option.requirementType === 2 && "radiobutton",
9117
+ (option.requirementType === 2 || option.requirementType === 3) && "radiobutton",
9118
9118
  ]) },
9119
9119
  React__default["default"].createElement("label", { htmlFor: "".concat(parentId, "_").concat(index), className: buildClassName([
9120
9120
  (option.requirementType === 0 ||
9121
9121
  option.requirementType === 1) &&
9122
9122
  "checkbox__label",
9123
- option.requirementType === 2 &&
9123
+ (option.requirementType === 2 || option.requirementType === 3) &&
9124
9124
  "radiobutton__label",
9125
9125
  ]) },
9126
9126
  React__default["default"].createElement(OptionItem, { option: option, parentId: parentId, index: index, selectedPrice: selectedPrice, onOptionChange: handleOptionChange }),
@@ -9436,7 +9436,7 @@ var Sidebar = function (_a) {
9436
9436
  (option === null || option === void 0 ? void 0 : option.isOnRequest)
9437
9437
  ? " (".concat(translations.SIDEBAR.ON_REQUEST, ")")
9438
9438
  : ""),
9439
- React__default["default"].createElement("div", { className: "pricing-summary__value" }, (option === null || option === void 0 ? void 0 : option.price) && formatPrice(option === null || option === void 0 ? void 0 : option.price))),
9439
+ React__default["default"].createElement("div", { className: "pricing-summary__value" }, option && option.price > 0 && formatPrice(option === null || option === void 0 ? void 0 : option.price))),
9440
9440
  React__default["default"].createElement("div", { className: "pricing-summary__row" },
9441
9441
  React__default["default"].createElement("div", { className: "price-summarty__property" }, option === null || option === void 0 ? void 0 : option.regimeName),
9442
9442
  React__default["default"].createElement("div", { className: "price-summary__value" }, getDatePeriodText(option === null || option === void 0 ? void 0 : option.from, option === null || option === void 0 ? void 0 : option.to, true)))));
@@ -8670,7 +8670,7 @@ var OptionItem = function (_a) {
8670
8670
  ? option.isSelected
8671
8671
  ? -option.line.price
8672
8672
  : option.line.price
8673
- : option.requirementType === 2
8673
+ : (option.requirementType === 2 || option.requirementType === 3)
8674
8674
  ? option.line.price - selectedPrice
8675
8675
  : 0;
8676
8676
  var accommodations = uniqBy(compact(__spreadArray([option.line], option.alternatives, true).map(function (option) {
@@ -8769,7 +8769,7 @@ var OptionItem = function (_a) {
8769
8769
  "checkbox__input",
8770
8770
  "checkbox__input--parent",
8771
8771
  ]), defaultChecked: option.isSelected, onChange: handleSelectionChange })),
8772
- option.requirementType === 2 && (React.createElement("input", { type: "radio", value: index, id: "".concat(parentId, "_").concat(index), name: parentId, className: buildClassName([
8772
+ (option.requirementType === 2 || option.requirementType === 3) && (React.createElement("input", { type: "radio", value: index, id: "".concat(parentId, "_").concat(index), name: parentId, className: buildClassName([
8773
8773
  "radiobutton__input",
8774
8774
  "radiobutton__input--parent",
8775
8775
  ]), defaultChecked: option.isSelected, onChange: handleSelectionChange })),
@@ -8816,7 +8816,7 @@ var OptionPaxGroup = function (_a) {
8816
8816
  var updatedGroup = __assign(__assign({}, group), { options: group.options.map(function (o, i) {
8817
8817
  return i === index
8818
8818
  ? option
8819
- : __assign(__assign({}, o), { isSelected: option.requirementType === 2 ? false : o.isSelected });
8819
+ : __assign(__assign({}, o), { isSelected: option.requirementType === 2 || option.requirementType === 3 ? false : o.isSelected });
8820
8820
  }) });
8821
8821
  if (onGroupChange)
8822
8822
  onGroupChange(updatedGroup, paxId, optionId);
@@ -8858,13 +8858,13 @@ var OptionPaxGroup = function (_a) {
8858
8858
  (option.requirementType === 0 ||
8859
8859
  option.requirementType === 1) &&
8860
8860
  "checkbox",
8861
- option.requirementType === 2 && "radiobutton",
8861
+ (option.requirementType === 2 || option.requirementType === 3) && "radiobutton",
8862
8862
  ]) },
8863
8863
  React.createElement("label", { htmlFor: "".concat(parentId, "_").concat(index), className: buildClassName([
8864
8864
  (option.requirementType === 0 ||
8865
8865
  option.requirementType === 1) &&
8866
8866
  "checkbox__label",
8867
- option.requirementType === 2 &&
8867
+ (option.requirementType === 2 || option.requirementType === 3) &&
8868
8868
  "radiobutton__label",
8869
8869
  ]) },
8870
8870
  React.createElement(OptionItem, { option: option, parentId: parentId, index: index, selectedPrice: selectedPrice, onOptionChange: handleOptionChange }),
@@ -8931,7 +8931,7 @@ var OptionUnitGroup = function (_a) {
8931
8931
  var updatedGroup = __assign(__assign({}, group), { options: group.options.map(function (o, i) {
8932
8932
  return i === index
8933
8933
  ? option
8934
- : __assign(__assign({}, o), { isSelected: option.requirementType === 2 ? false : o.isSelected });
8934
+ : __assign(__assign({}, o), { isSelected: option.requirementType === 2 || option.requirementType === 3 ? false : o.isSelected });
8935
8935
  }) });
8936
8936
  if (onGroupChange)
8937
8937
  onGroupChange(updatedGroup, unitIndex, optionId);
@@ -8980,13 +8980,13 @@ var OptionUnitGroup = function (_a) {
8980
8980
  (option.requirementType === 0 ||
8981
8981
  option.requirementType === 1) &&
8982
8982
  "checkbox",
8983
- option.requirementType === 2 && "radiobutton",
8983
+ (option.requirementType === 2 || option.requirementType === 3) && "radiobutton",
8984
8984
  ]) },
8985
8985
  React.createElement("label", { htmlFor: "".concat(parentId, "_").concat(index), className: buildClassName([
8986
8986
  (option.requirementType === 0 ||
8987
8987
  option.requirementType === 1) &&
8988
8988
  "checkbox__label",
8989
- option.requirementType === 2 &&
8989
+ (option.requirementType === 2 || option.requirementType === 3) &&
8990
8990
  "radiobutton__label",
8991
8991
  ]) },
8992
8992
  React.createElement(OptionItem, { option: option, parentId: parentId, index: index, selectedPrice: selectedPrice, onOptionChange: handleOptionChange }),
@@ -9047,7 +9047,7 @@ var OptionBookingGroup = function (_a) {
9047
9047
  var updatedGroup = __assign(__assign({}, group), { options: group.options.map(function (o, i) {
9048
9048
  return i === index
9049
9049
  ? option
9050
- : __assign(__assign({}, o), { isSelected: option.requirementType === 2 ? false : o.isSelected });
9050
+ : __assign(__assign({}, o), { isSelected: (option.requirementType === 2 || option.requirementType === 3) ? false : o.isSelected });
9051
9051
  }) });
9052
9052
  if (onGroupChange)
9053
9053
  onGroupChange(updatedGroup, optionId);
@@ -9103,13 +9103,13 @@ var OptionBookingGroup = function (_a) {
9103
9103
  (option.requirementType === 0 ||
9104
9104
  option.requirementType === 1) &&
9105
9105
  "checkbox",
9106
- option.requirementType === 2 && "radiobutton",
9106
+ (option.requirementType === 2 || option.requirementType === 3) && "radiobutton",
9107
9107
  ]) },
9108
9108
  React.createElement("label", { htmlFor: "".concat(parentId, "_").concat(index), className: buildClassName([
9109
9109
  (option.requirementType === 0 ||
9110
9110
  option.requirementType === 1) &&
9111
9111
  "checkbox__label",
9112
- option.requirementType === 2 &&
9112
+ (option.requirementType === 2 || option.requirementType === 3) &&
9113
9113
  "radiobutton__label",
9114
9114
  ]) },
9115
9115
  React.createElement(OptionItem, { option: option, parentId: parentId, index: index, selectedPrice: selectedPrice, onOptionChange: handleOptionChange }),
@@ -9425,7 +9425,7 @@ var Sidebar = function (_a) {
9425
9425
  (option === null || option === void 0 ? void 0 : option.isOnRequest)
9426
9426
  ? " (".concat(translations.SIDEBAR.ON_REQUEST, ")")
9427
9427
  : ""),
9428
- React.createElement("div", { className: "pricing-summary__value" }, (option === null || option === void 0 ? void 0 : option.price) && formatPrice(option === null || option === void 0 ? void 0 : option.price))),
9428
+ React.createElement("div", { className: "pricing-summary__value" }, option && option.price > 0 && formatPrice(option === null || option === void 0 ? void 0 : option.price))),
9429
9429
  React.createElement("div", { className: "pricing-summary__row" },
9430
9430
  React.createElement("div", { className: "price-summarty__property" }, option === null || option === void 0 ? void 0 : option.regimeName),
9431
9431
  React.createElement("div", { className: "price-summary__value" }, getDatePeriodText(option === null || option === void 0 ? void 0 : option.from, option === null || option === void 0 ? void 0 : option.to, true)))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-booking-component",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "React BookingWizard component for Tide",
5
5
  "main": "build/build-cjs/index.js",
6
6
  "module": "build/build-esm/index.js",
@@ -41,7 +41,7 @@ const OptionBookingGroup: React.FC<OptionBookingGroupProps> = ({
41
41
  ? option
42
42
  : {
43
43
  ...o,
44
- isSelected: option.requirementType === 2 ? false : o.isSelected,
44
+ isSelected: (option.requirementType === 2 || option.requirementType === 3) ? false : o.isSelected,
45
45
  };
46
46
  }),
47
47
  } as BookingOptionGroup<PerBookingPackageOption>;
@@ -139,7 +139,7 @@ const OptionBookingGroup: React.FC<OptionBookingGroupProps> = ({
139
139
  (option.requirementType === 0 ||
140
140
  option.requirementType === 1) &&
141
141
  "checkbox",
142
- option.requirementType === 2 && "radiobutton",
142
+ (option.requirementType === 2 || option.requirementType === 3) && "radiobutton",
143
143
  ])}
144
144
  >
145
145
  <label
@@ -148,7 +148,7 @@ const OptionBookingGroup: React.FC<OptionBookingGroupProps> = ({
148
148
  (option.requirementType === 0 ||
149
149
  option.requirementType === 1) &&
150
150
  "checkbox__label",
151
- option.requirementType === 2 &&
151
+ (option.requirementType === 2 || option.requirementType === 3) &&
152
152
  "radiobutton__label",
153
153
  ])}
154
154
  >
@@ -28,7 +28,7 @@ const OptionItem: React.FC<OptionItemProps> = ({
28
28
  ? option.isSelected
29
29
  ? -option.line.price
30
30
  : option.line.price
31
- : option.requirementType === 2
31
+ : (option.requirementType === 2 || option.requirementType === 3)
32
32
  ? option.line.price - selectedPrice
33
33
  : 0;
34
34
 
@@ -203,7 +203,7 @@ const OptionItem: React.FC<OptionItemProps> = ({
203
203
  onChange={handleSelectionChange}
204
204
  ></input>
205
205
  )}
206
- {option.requirementType === 2 && (
206
+ {(option.requirementType === 2 || option.requirementType === 3) && (
207
207
  <input
208
208
  type="radio"
209
209
  value={index}
@@ -40,7 +40,7 @@ const OptionPaxGroup: React.FC<OptionPaxGroupProps> = ({
40
40
  ? option
41
41
  : {
42
42
  ...o,
43
- isSelected: option.requirementType === 2 ? false : o.isSelected,
43
+ isSelected: option.requirementType === 2 || option.requirementType === 3 ? false : o.isSelected,
44
44
  };
45
45
  }),
46
46
  } as BookingOptionGroup<PerPaxPackageOption>;
@@ -111,7 +111,7 @@ const OptionPaxGroup: React.FC<OptionPaxGroupProps> = ({
111
111
  (option.requirementType === 0 ||
112
112
  option.requirementType === 1) &&
113
113
  "checkbox",
114
- option.requirementType === 2 && "radiobutton",
114
+ (option.requirementType === 2 || option.requirementType === 3) && "radiobutton",
115
115
  ])}
116
116
  >
117
117
  <label
@@ -120,7 +120,7 @@ const OptionPaxGroup: React.FC<OptionPaxGroupProps> = ({
120
120
  (option.requirementType === 0 ||
121
121
  option.requirementType === 1) &&
122
122
  "checkbox__label",
123
- option.requirementType === 2 &&
123
+ (option.requirementType === 2 || option.requirementType === 3) &&
124
124
  "radiobutton__label",
125
125
  ])}
126
126
  >
@@ -42,7 +42,7 @@ const OptionUnitGroup: React.FC<OptionUnitGroupProps> = ({
42
42
  ? option
43
43
  : {
44
44
  ...o,
45
- isSelected: option.requirementType === 2 ? false : o.isSelected,
45
+ isSelected: option.requirementType === 2 || option.requirementType === 3 ? false : o.isSelected,
46
46
  };
47
47
  }),
48
48
  } as BookingOptionGroup<PerUnitPackageOption>;
@@ -127,7 +127,7 @@ const OptionUnitGroup: React.FC<OptionUnitGroupProps> = ({
127
127
  (option.requirementType === 0 ||
128
128
  option.requirementType === 1) &&
129
129
  "checkbox",
130
- option.requirementType === 2 && "radiobutton",
130
+ (option.requirementType === 2 || option.requirementType === 3) && "radiobutton",
131
131
  ])}
132
132
  >
133
133
  <label
@@ -136,7 +136,7 @@ const OptionUnitGroup: React.FC<OptionUnitGroupProps> = ({
136
136
  (option.requirementType === 0 ||
137
137
  option.requirementType === 1) &&
138
138
  "checkbox__label",
139
- option.requirementType === 2 &&
139
+ (option.requirementType === 2 || option.requirementType === 3) &&
140
140
  "radiobutton__label",
141
141
  ])}
142
142
  >
@@ -157,7 +157,7 @@ const Sidebar: React.FC<SidebarProps> = ({
157
157
  : ""}
158
158
  </div>
159
159
  <div className="pricing-summary__value">
160
- {option?.price && formatPrice(option?.price)}
160
+ {option && option.price > 0 && formatPrice(option?.price)}
161
161
  </div>
162
162
  </div>
163
163
  <div className="pricing-summary__row">