@escapenavigator/hooks 2.1.3 → 2.1.5

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.
@@ -128,8 +128,10 @@ export type PlayersAndVariationPickerProps = {
128
128
  hidePriceHints?: boolean;
129
129
  /**
130
130
  * Опция «Определимся на месте» (questroom.playersSelectMode=OPTIONAL).
131
- * Пока выбрана — строки состава скрыты и состав сброшен, ценовые
132
- * подсказки не показываются: хост рендерит «базовую стоимость от» сам.
131
+ * Стоит первым пунктом и выбрана по умолчанию, но теги/строки состава
132
+ * остаются видимыми — гость может указать точное число. Пока flex
133
+ * выбран, ни одно число не подсвечено, ценовые подсказки скрыты:
134
+ * хост рендерит «базовую стоимость от» сам.
133
135
  */
134
136
  flexPlayersOption?: {
135
137
  selected: boolean;
@@ -399,29 +399,31 @@ const PlayersAndVariationPicker = ({ slot, currentTariffId, currentDuration, loa
399
399
  ? categoryTitle(baseCategory)
400
400
  : t('prices:choosePlayersAmount')),
401
401
  !hasExtraRows && !flexSelected && !!tariff[pricingHeads] && (react_1.default.createElement(typography_1.Typography.Text, { view: 'title', color: 'secondary' }, (0, format_amount_1.formatAmount)(tariff[pricingHeads], currency)))),
402
- !!flexPlayersOption && (react_1.default.createElement(flex_1.Flex, { gap: 'xs', wrap: true, justify: 'start' },
403
- react_1.default.createElement(tag_1.Tag, { key: 'flex-players', text: flexPlayersOption.label, onClick: handleSelectFlex, view: flexSelected ? 'primary-inverted' : 'primary' }))),
404
- !flexSelected && !hasExtraRows && (react_1.default.createElement(flex_1.Flex, { gap: 'xs', wrap: true, justify: 'start' }, baseLevelOptions.map((level) => (react_1.default.createElement(tag_1.Tag, { key: `level-${level}`, text: `${level}`, onClick: () => handleSelectLevel(level), view: pricingHeads === level ? 'primary-inverted' : 'primary' }))))),
405
- !flexSelected &&
406
- (hasExtraRows ? categories : addOnCategories).map((category) => {
407
- var _a, _b;
408
- const value = Math.max(0, _composition[category.key] || 0);
409
- const rowMax = (_a = maxByCategory[category.key]) !== null && _a !== void 0 ? _a : value;
410
- const plusLimitHint = value >= rowMax
411
- ? capacityReached
412
- ? t('prices:capacityReached', {
413
- count: capacityMax,
414
- defaultValue: 'Максимум {{count}} участников',
415
- })
416
- : t('prices:pricingMaxReached', {
417
- count: pricingMax,
418
- defaultValue: 'Максимум {{count}} участников по этому тарифу',
419
- })
420
- : undefined;
421
- return (react_1.default.createElement(ticket_row_1.TicketRow, { key: category.key, title: categoryTitle(category), priceHint: categoryPriceHint(category), description: !hidePriceHints
422
- ? ((_b = category.description) === null || _b === void 0 ? void 0 : _b.trim()) || undefined
423
- : undefined, value: value, min: 0, max: rowMax, minusLabel: t('prices:minus', { defaultValue: 'На одного меньше' }), plusLabel: t('prices:plus', { defaultValue: 'На одного больше' }), plusDisabledHint: plusLimitHint, onChange: (next) => handleChangeCategory(category.key, next) }));
424
- })),
402
+ (!!flexPlayersOption || !hasExtraRows) && (react_1.default.createElement(flex_1.Flex, { gap: 'xs', wrap: true, justify: 'start' },
403
+ !!flexPlayersOption && (react_1.default.createElement(tag_1.Tag, { key: 'flex-players', text: flexPlayersOption.label, onClick: handleSelectFlex, view: flexSelected ? 'primary-inverted' : 'primary' })),
404
+ !hasExtraRows &&
405
+ baseLevelOptions.map((level) => (react_1.default.createElement(tag_1.Tag, { key: `level-${level}`, text: `${level}`, onClick: () => handleSelectLevel(level), view: !flexSelected && pricingHeads === level
406
+ ? 'primary-inverted'
407
+ : 'primary' }))))),
408
+ (hasExtraRows ? categories : addOnCategories).map((category) => {
409
+ var _a, _b;
410
+ const value = Math.max(0, _composition[category.key] || 0);
411
+ const rowMax = (_a = maxByCategory[category.key]) !== null && _a !== void 0 ? _a : value;
412
+ const plusLimitHint = value >= rowMax
413
+ ? capacityReached
414
+ ? t('prices:capacityReached', {
415
+ count: capacityMax,
416
+ defaultValue: 'Максимум {{count}} участников',
417
+ })
418
+ : t('prices:pricingMaxReached', {
419
+ count: pricingMax,
420
+ defaultValue: 'Максимум {{count}} участников по этому тарифу',
421
+ })
422
+ : undefined;
423
+ return (react_1.default.createElement(ticket_row_1.TicketRow, { key: category.key, title: categoryTitle(category), priceHint: categoryPriceHint(category), description: !hidePriceHints
424
+ ? ((_b = category.description) === null || _b === void 0 ? void 0 : _b.trim()) || undefined
425
+ : undefined, value: value, min: 0, max: rowMax, minusLabel: t('prices:minus', { defaultValue: 'На одного меньше' }), plusLabel: t('prices:plus', { defaultValue: 'На одного больше' }), plusDisabledHint: plusLimitHint, onChange: (next) => handleChangeCategory(category.key, next) }));
426
+ })),
425
427
  !hidePriceHints && !flexSelected && bookable && (react_1.default.createElement(flex_columns_1.FlexColumns, { columns: 1, gr: 4, gc: 0 }, priceSummary)),
426
428
  hidePriceHints && !flexSelected && bookable && (react_1.default.createElement("div", { style: {
427
429
  display: 'flex',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escapenavigator/hooks",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,9 +14,9 @@
14
14
  "test": "jest"
15
15
  },
16
16
  "dependencies": {
17
- "@escapenavigator/services": "^2.1.3",
18
- "@escapenavigator/types": "^2.1.3",
19
- "@escapenavigator/utils": "^2.1.3",
17
+ "@escapenavigator/services": "^2.1.5",
18
+ "@escapenavigator/types": "^2.1.5",
19
+ "@escapenavigator/utils": "^2.1.5",
20
20
  "libphonenumber-js": "^1.12.24",
21
21
  "react": "19.2.6",
22
22
  "react-phone-input-2": "^2.15.1"
@@ -32,5 +32,5 @@
32
32
  "ts-jest": "^29.1.1",
33
33
  "typescript": "^5.6"
34
34
  },
35
- "gitHead": "5b85efe5deb145b844c018076f1bfcd2a14a3299"
35
+ "gitHead": "d8214323f0f1fc011d7c57a80e1d148ddad821bc"
36
36
  }