@escapenavigator/hooks 2.1.11 → 2.1.14
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.
|
@@ -124,6 +124,8 @@ export type PlayersAndVariationPickerProps = {
|
|
|
124
124
|
/**
|
|
125
125
|
* Прячет встроенные ценовые подсказки и показывает вместо них одну
|
|
126
126
|
* пунктирную сводку. Нужен виджету, который сводит цену в одно место.
|
|
127
|
+
* Правила категории (`description`) не прячет — гостю нужно видеть,
|
|
128
|
+
* кому строка.
|
|
127
129
|
*/
|
|
128
130
|
hidePriceHints?: boolean;
|
|
129
131
|
/**
|
|
@@ -420,9 +420,7 @@ const PlayersAndVariationPicker = ({ slot, currentTariffId, currentDuration, loa
|
|
|
420
420
|
defaultValue: 'Максимум {{count}} участников по этому тарифу',
|
|
421
421
|
})
|
|
422
422
|
: undefined;
|
|
423
|
-
return (react_1.default.createElement(ticket_row_1.TicketRow, { key: category.key, title: categoryTitle(category), priceHint: categoryPriceHint(category), description:
|
|
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) }));
|
|
423
|
+
return (react_1.default.createElement(ticket_row_1.TicketRow, { key: category.key, title: categoryTitle(category), priceHint: categoryPriceHint(category), description: ((_b = category.description) === null || _b === void 0 ? void 0 : _b.trim()) || 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
424
|
})),
|
|
427
425
|
!hidePriceHints && !flexSelected && bookable && (react_1.default.createElement(flex_columns_1.FlexColumns, { columns: 1, gr: 4, gc: 0 }, priceSummary)),
|
|
428
426
|
hidePriceHints && !flexSelected && bookable && (react_1.default.createElement("div", { style: {
|
|
@@ -15,6 +15,9 @@ type Props = {
|
|
|
15
15
|
/**
|
|
16
16
|
* Строка спеццены: слева что это за места и сколько они снимают
|
|
17
17
|
* с группового тарифа, справа сколько таких мест в брони.
|
|
18
|
+
*
|
|
19
|
+
* Правила категории — одна усечённая строка под названием, полный
|
|
20
|
+
* текст по «?», как у допов в виджете. Карточки остаются одной высоты.
|
|
18
21
|
*/
|
|
19
22
|
export declare const TicketRow: React.FC<Props>;
|
|
20
23
|
export {};
|
|
@@ -39,7 +39,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.TicketRow = void 0;
|
|
40
40
|
const MinusM_1 = __importDefault(require("@alphakits/icons/dist/MinusM"));
|
|
41
41
|
const PlusM_1 = __importDefault(require("@alphakits/icons/dist/PlusM"));
|
|
42
|
+
const QuestionMarkS_1 = __importDefault(require("@alphakits/icons/dist/QuestionMarkS"));
|
|
42
43
|
const dist_1 = require("@alphakits/ui/dist");
|
|
44
|
+
const tooltip_1 = require("@alphakits/ui/dist/tooltip");
|
|
43
45
|
const typography_1 = require("@alphakits/ui/dist/typography");
|
|
44
46
|
const functional_popover_panel_style_1 = require("@escapenavigator/utils/dist/functional-popover-panel-style");
|
|
45
47
|
const react_1 = __importStar(require("react"));
|
|
@@ -47,18 +49,28 @@ const index_module_css_1 = __importDefault(require("./index.module.css"));
|
|
|
47
49
|
/**
|
|
48
50
|
* Строка спеццены: слева что это за места и сколько они снимают
|
|
49
51
|
* с группового тарифа, справа сколько таких мест в брони.
|
|
52
|
+
*
|
|
53
|
+
* Правила категории — одна усечённая строка под названием, полный
|
|
54
|
+
* текст по «?», как у допов в виджете. Карточки остаются одной высоты.
|
|
50
55
|
*/
|
|
51
56
|
const TicketRow = ({ title, priceHint, description, value, min, max, minusLabel, plusLabel, plusDisabledHint, onChange, }) => {
|
|
52
57
|
const active = value > min;
|
|
53
58
|
const plusLocked = value >= max;
|
|
54
59
|
const plusWrapRef = (0, react_1.useRef)(null);
|
|
55
60
|
const [plusHintOpen, setPlusHintOpen] = (0, react_1.useState)(false);
|
|
61
|
+
const rules = description === null || description === void 0 ? void 0 : description.trim();
|
|
56
62
|
(0, dist_1.useClickOutside)(plusWrapRef, () => setPlusHintOpen(false));
|
|
57
63
|
return (react_1.default.createElement("div", { className: active ? `${index_module_css_1.default.ticket} ${index_module_css_1.default.ticketActive}` : index_module_css_1.default.ticket },
|
|
58
64
|
react_1.default.createElement("div", { className: index_module_css_1.default.body },
|
|
59
|
-
react_1.default.createElement(
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
react_1.default.createElement("div", { className: index_module_css_1.default.titleRow },
|
|
66
|
+
react_1.default.createElement(typography_1.Typography.Text, { view: 'primary-small', weight: 'medium' }, title),
|
|
67
|
+
!!rules && (react_1.default.createElement(tooltip_1.Tooltip, { trigger: 'click', position: 'top', content: react_1.default.createElement("div", { className: index_module_css_1.default.rulesPanel },
|
|
68
|
+
react_1.default.createElement(typography_1.Typography.Text, { view: 'primary-small', color: 'primary' }, rules)) },
|
|
69
|
+
react_1.default.createElement("button", { type: 'button', className: index_module_css_1.default.infoButton, "aria-label": title },
|
|
70
|
+
react_1.default.createElement(QuestionMarkS_1.default, null))))),
|
|
71
|
+
!!rules && (react_1.default.createElement("div", { className: index_module_css_1.default.preview },
|
|
72
|
+
react_1.default.createElement(typography_1.Typography.Text, { view: 'caps', color: 'secondary' }, rules))),
|
|
73
|
+
react_1.default.createElement(typography_1.Typography.Text, { view: 'caps', color: 'secondary' }, priceHint)),
|
|
62
74
|
react_1.default.createElement("div", { className: index_module_css_1.default.stub },
|
|
63
75
|
react_1.default.createElement("button", { type: 'button', className: index_module_css_1.default.stepperButton, "aria-label": minusLabel, disabled: value <= min, onClick: () => onChange(Math.max(min, value - 1)) },
|
|
64
76
|
react_1.default.createElement(MinusM_1.default, null)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@escapenavigator/hooks",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.14",
|
|
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.
|
|
18
|
-
"@escapenavigator/types": "^2.1.
|
|
19
|
-
"@escapenavigator/utils": "^2.1.
|
|
17
|
+
"@escapenavigator/services": "^2.1.14",
|
|
18
|
+
"@escapenavigator/types": "^2.1.13",
|
|
19
|
+
"@escapenavigator/utils": "^2.1.14",
|
|
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": "
|
|
35
|
+
"gitHead": "c43b309381f1541293a3c5cf74f4ac11ae14cdf8"
|
|
36
36
|
}
|