@roomstay/frontend 2.6.77 → 2.6.79-0
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/dist/430.bundle.js +1 -1
- package/dist/456.bundle.js +1 -0
- package/dist/537.bundle.js +1 -1
- package/dist/977.bundle.js +1 -0
- package/dist/978.bundle.js +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/src/api/BookingAPI.d.ts +2 -0
- package/dist/src/api/BookingAPI.js +2 -0
- package/dist/src/api/BookingAPI.js.map +1 -1
- package/dist/src/api/HotelAPI.d.ts +2 -0
- package/dist/src/api/HotelAPI.js +7 -0
- package/dist/src/api/HotelAPI.js.map +1 -1
- package/dist/src/api/ReservationAPI.js +12 -9
- package/dist/src/api/ReservationAPI.js.map +1 -1
- package/dist/src/api/TrueRewardsAPI.d.ts +4 -0
- package/dist/src/api/TrueRewardsAPI.js +37 -0
- package/dist/src/api/TrueRewardsAPI.js.map +1 -0
- package/dist/src/components/generic/BookingWizard/BookingWizard.d.ts +1 -0
- package/dist/src/components/generic/BookingWizard/BookingWizard.js +7 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardBottomSheet/BookingWizardBottomSheet.js +0 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardBottomSheet/BookingWizardBottomSheet.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardContent.d.ts +13 -4
- package/dist/src/components/generic/BookingWizard/BookingWizardContent.js +24 -10
- package/dist/src/components/generic/BookingWizard/BookingWizardContent.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardDateSelector/BookingWizardDateSelector.js +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardDateSelector/BookingWizardDateSelector.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardHotelSelector/BookingWizardHotelSelector.d.ts +9 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardHotelSelector/BookingWizardHotelSelector.js +187 -22
- package/dist/src/components/generic/BookingWizard/BookingWizardHotelSelector/BookingWizardHotelSelector.js.map +1 -1
- package/dist/src/components/generic/Event/EventCard.js +16 -8
- package/dist/src/components/generic/Event/EventCard.js.map +1 -1
- package/dist/src/components/generic/Event/EventCarousel.js +3 -1
- package/dist/src/components/generic/Event/EventCarousel.js.map +1 -1
- package/dist/src/components/generic/RadioButtonGroup/RadioButtonGroup.js +9 -2
- package/dist/src/components/generic/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/dist/src/components/generic/Select/Select.d.ts +2 -1
- package/dist/src/components/generic/Select/Select.js +2 -2
- package/dist/src/components/generic/Select/Select.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js +11 -10
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js +11 -4
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.d.ts +7 -0
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.js +54 -0
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.js.map +1 -0
- package/dist/src/components/steps/confirmation/TrueRewardsPaymentOption/TrueRewardsLabel.d.ts +2 -0
- package/dist/src/components/steps/confirmation/TrueRewardsPaymentOption/TrueRewardsLabel.js +53 -0
- package/dist/src/components/steps/confirmation/TrueRewardsPaymentOption/TrueRewardsLabel.js.map +1 -0
- package/dist/src/components/steps/confirmation/TrueRewardsPaymentOption/TrueRewardsPaymentMethod.d.ts +2 -0
- package/dist/src/components/steps/confirmation/TrueRewardsPaymentOption/TrueRewardsPaymentMethod.js +115 -0
- package/dist/src/components/steps/confirmation/TrueRewardsPaymentOption/TrueRewardsPaymentMethod.js.map +1 -0
- package/dist/src/components/steps/room/AvailableUpgradesModal.js +0 -5
- package/dist/src/components/steps/room/AvailableUpgradesModal.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/PriceBreakdownBlock.js +2 -2
- package/dist/src/components/steps/room/roomDetails/roomRates/PriceBreakdownBlock.js.map +1 -1
- package/dist/src/components/summary/BESummaryRoomRow.js +1 -1
- package/dist/src/components/summary/BESummaryRoomRow.js.map +1 -1
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js +63 -11
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js.map +1 -1
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js +3 -1
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +5 -2
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js +10 -2
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js.map +1 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.d.ts +7 -0
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.js.map +1 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js +1 -0
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js.map +1 -1
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js +3 -0
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js.map +1 -1
- package/dist/src/handlers/payment/TrueRewardsPaymentHandler.d.ts +2 -0
- package/dist/src/handlers/payment/TrueRewardsPaymentHandler.js +44 -0
- package/dist/src/handlers/payment/TrueRewardsPaymentHandler.js.map +1 -0
- package/dist/src/hooks/RoomRateAvailabilityListFromApi.js +1 -0
- package/dist/src/hooks/RoomRateAvailabilityListFromApi.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +4 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/models/Api/HotelDTO.d.ts +1 -0
- package/dist/src/models/Api/HotelDTO.js.map +1 -1
- package/dist/src/models/BasketRow.d.ts +2 -1
- package/dist/src/models/BasketRow.js +32 -2
- package/dist/src/models/BasketRow.js.map +1 -1
- package/dist/src/models/BookingWizard/BookingWizardProperty.d.ts +13 -0
- package/dist/src/models/BookingWizard/BookingWizardProperty.js.map +1 -1
- package/dist/src/models/Client/Hotel/Hotel.d.ts +1 -0
- package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
- package/dist/src/models/RoomstaySession.d.ts +1 -0
- package/dist/src/models/RoomstaySession.js.map +1 -1
- package/dist/src/providers/FeatureProvider.js +2 -0
- package/dist/src/providers/FeatureProvider.js.map +1 -1
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.d.ts +10 -0
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.js +13 -0
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.js.map +1 -0
- package/dist/src/providers/feature/Feature.d.ts +2 -0
- package/dist/src/providers/feature/Feature.js +4 -0
- package/dist/src/providers/feature/Feature.js.map +1 -1
- package/dist/src/providers/storage/SessionProvider.js +2 -0
- package/dist/src/providers/storage/SessionProvider.js.map +1 -1
- package/dist/src/translations/Translation.d.ts +20 -0
- package/dist/src/translations/Translation.js +20 -0
- package/dist/src/translations/Translation.js.map +1 -1
- package/dist/src/translations/languages/en-gb.js +20 -0
- package/dist/src/translations/languages/en-gb.js.map +1 -1
- package/dist/src/util/TotalCalculator.js.map +1 -1
- package/dist/test.bundle.js +1 -1
- package/dist/vendors.bundle.js +1 -1
- package/package.json +3 -3
- package/dist/659.bundle.js +0 -1
- package/dist/984.bundle.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventCarousel.js","sourceRoot":"/","sources":["src/components/generic/Event/EventCarousel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAAoC;AACpC,+CAAwE;AACxE,mCAAoC;AACpC,wCAAmD;AAEnD,iFAAyD;A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C,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAAI,CACrH,CACJ,CACJ;QACN,8BAAC,wBAAc,IAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;YAC/C,uCAAK,SAAS,EAAC,mBAAmB;gBAC9B,uCAAK,SAAS,EAAE,mCAAM,CAAC,eAAe;oBAClC,uCAAK,SAAS,EAAC,WAAW;wBACtB,8BAAC,cAAM,IACH,UAAU,EAAE,CAAC,KAAK,EAClB,OAAO,EAAE,CAAC,mBAAU,CAAC,EACrB,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAC7B,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM;4BACnC,2CAA2C;4BAC3C,iBAAiB,EAAC,QAAQ,IAEzB,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,8BAAC,mBAAW,IACR,KAAK,EAAE;gCACH,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG;6BACjC,EACD,GAAG,EAAE,KAAK;4BAEV,8BAAC,mBAAS,IAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,EAAE,KAAK,EAAE,KAAK,GAAI,CACvD,CACjB,CAAC,CACG,CACP,CACJ,CACJ,CACO,CACf,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC","sourcesContent":["import { IRoomstayEvent } from '@roomstay/core';\nimport classNames from 'classnames';\nimport React, { FC, PropsWithChildren, useMemo, useState } from 'react';\nimport { Navigation } from 'swiper';\nimport { Swiper, SwiperSlide } from 'swiper/react';\n\nimport AutoAutoHeight from '@/animations/AutoAutoHeight';\nimport EventCard from '@/components/generic/Event/EventCard';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport Text, { TextType } from '@/components/generic/Text';\nimport { Color } from '@/util/Color';\n\nimport styles from './EventCarousel.module.scss';\n\nexport interface EventCarouselProps {\n small?: boolean;\n data?: IRoomstayEvent[];\n defaultExpanded?: boolean;\n}\n\nconst EventCarousel: FC<EventCarouselProps> = ({ small = false, data = [], defaultExpanded = false }) => {\n const [expanded, setExpanded] = useState<boolean>(defaultExpanded);\n const commonTitleProps = useMemo(\n () => ({\n color: Color.Accent,\n className: classNames({\n [styles.titleWidthLimited]: small,\n }),\n }),\n [small]\n );\n const headlineProps = useMemo(\n () =>\n small\n ? {\n ...commonTitleProps,\n type: TextType.Body,\n bold: true,\n }\n : {\n ...commonTitleProps,\n size: 'large',\n },\n [small]\n );\n\n const [TitleComponent, titleProps]: [FC, PropsWithChildren<any>] = useMemo(() => [small ? Text : Headline, headlineProps], [small]);\n\n return (\n <div className=\"u-w-fluid u-pad-bottom\">\n <div className=\"container\">\n <div\n className={styles.headline}\n onClick={() => {\n setExpanded(!expanded);\n }}\n >\n <div\n className={classNames('u-flex u-w-100', 'u-flex-nowrap', 'u-flex-gap', 'u-flex-align-center', {\n 'u-flex-justify-flex-start': !small,\n 'u-flex-justify-space-between': small,\n })}\n >\n <TitleComponent {...titleProps}>We recommend during your stay</TitleComponent>\n <Icon icon={!expanded ? IconType.ArrowDown3 : IconType.ArrowUp3} color={Color.Accent} size={small ? '18px' : '32px'} />\n </div>\n </div>\n </div>\n <AutoAutoHeight open={expanded} startOpen={expanded}>\n <div className=\"u-pad-top--medium\">\n <div className={styles.swiperContainer}>\n <div className=\"container\">\n <Swiper\n navigation={!small}\n modules={[Navigation]}\n spaceBetween={small ? 20 : 30}\n slidesPerView={small ? 1.2 : 'auto'}\n // Prevent Swiper Slide move on click event\n noSwipingSelector=\"button\"\n >\n {data.map((event, index) => (\n <SwiperSlide\n style={{\n width: small ? undefined : 524,\n }}\n key={index}\n >\n <EventCard ratio={small ? 380 / 345 : 380 / 524} event={event} />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </div>\n </div>\n </AutoAutoHeight>\n </div>\n );\n};\n\nexport default EventCarousel;\n"]}
|
|
@@ -49,7 +49,7 @@ const Option = ({ option: optionProp, value: valueProp, onChange, renderChildren
|
|
|
49
49
|
const [ref, setRef] = (0, react_1.useState)(null);
|
|
50
50
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
51
51
|
const option = isGroup && valueProp ? options.find(({ value }) => value === valueProp) || optionProp : optionProp;
|
|
52
|
-
const radioButton = (react_1.default.createElement(RadioButton_1.RadioButton, { headerRef: setRef, className: RadioButtonGroup_module_scss_1.default.item,
|
|
52
|
+
const radioButton = (react_1.default.createElement(RadioButton_1.RadioButton, { headerRef: setRef, className: RadioButtonGroup_module_scss_1.default.item, key: option === null || option === void 0 ? void 0 : option.value, checked: !(option === null || option === void 0 ? void 0 : option.disabled) && (option === null || option === void 0 ? void 0 : option.value) === valueProp, onChange: () => {
|
|
53
53
|
if (option === null || option === void 0 ? void 0 : option.disabled)
|
|
54
54
|
return;
|
|
55
55
|
if (isGroup)
|
|
@@ -57,13 +57,20 @@ const Option = ({ option: optionProp, value: valueProp, onChange, renderChildren
|
|
|
57
57
|
else if ((option === null || option === void 0 ? void 0 : option.value) && (option === null || option === void 0 ? void 0 : option.value) !== valueProp)
|
|
58
58
|
onChange === null || onChange === void 0 ? void 0 : onChange(option.value, optionProp.value);
|
|
59
59
|
}, label: option === null || option === void 0 ? void 0 : option.label, disabled: option === null || option === void 0 ? void 0 : option.disabled, renderContent: option === null || option === void 0 ? void 0 : option.renderContent }));
|
|
60
|
+
const isSelected = !isGroup && (option === null || option === void 0 ? void 0 : option.value) === valueProp;
|
|
61
|
+
const isExpanded = isGroup && open;
|
|
62
|
+
const dropDownIndicatorStyle = !(option === null || option === void 0 ? void 0 : option.renderContent) && !isGroup
|
|
63
|
+
? { transform: 'translateX(1px) translateY(-2px) rotate(270deg)' }
|
|
64
|
+
: isSelected || isExpanded
|
|
65
|
+
? { transform: 'scaleY(-1) translateY(2px)' }
|
|
66
|
+
: undefined;
|
|
60
67
|
if ((option === null || option === void 0 ? void 0 : option.disabled) && (option === null || option === void 0 ? void 0 : option.disabledReason)) {
|
|
61
68
|
return (react_1.default.createElement(Tooltip_1.default, { key: option === null || option === void 0 ? void 0 : option.value, wrapperClasses: RadioButtonGroup_module_scss_1.default.wrapper, title: option === null || option === void 0 ? void 0 : option.disabledReason }, radioButton));
|
|
62
69
|
}
|
|
63
70
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
64
71
|
react_1.default.createElement("div", { key: option === null || option === void 0 ? void 0 : option.value, className: RadioButtonGroup_module_scss_1.default.wrapper },
|
|
65
72
|
radioButton,
|
|
66
|
-
!isSubOption && (react_1.default.createElement("div", { className: RadioButtonGroup_module_scss_1.default.childrenIndicator, style:
|
|
73
|
+
!isSubOption && (react_1.default.createElement("div", { className: RadioButtonGroup_module_scss_1.default.childrenIndicator, style: dropDownIndicatorStyle },
|
|
67
74
|
react_1.default.createElement(Icon_1.default, { size: "24px", icon: Icon_1.IconType.Dropdown })))),
|
|
68
75
|
options && (react_1.default.createElement(Overlay_1.Overlay, { onClose: () => setOpen(false), className: RadioButtonGroup_module_scss_1.default.overlay, hideStyles: true, containerClassName: "u-w-100", open: open, followElement: ref || undefined, offset: [0, 0], placement: "bottom-start" },
|
|
69
76
|
react_1.default.createElement(RadioButtonGroup, { options: options.map((option) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtonGroup.js","sourceRoot":"/","sources":["src/components/generic/RadioButtonGroup/RadioButtonGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiE;AAEjE,uEAAgE;AAChE,kEAA+D;AAC/D,mFAAgF;AAChF,mFAA2D;AAE3D,kGAAoD;AAoBpD,MAAM,MAAM,GAAG,CAAiC,EAC5C,MAAM,EAAE,UAAU,EA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AAU,GAAI,CACnK,CAAC,CACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC","sourcesContent":["import React, { ReactElement, ReactNode, useState } from 'react';\n\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport { Overlay } from '@/components/generic/Overlay/Overlay';\nimport { RadioButton } from '@/components/generic/RadioButtonGroup/RadioButton';\nimport Tooltip from '@/components/generic/Tooltip/Tooltip';\n\nimport styles from './RadioButtonGroup.module.scss';\n\nexport interface IRadioButtonOption<TValue extends string = string> {\n value: TValue;\n label?: ReactNode;\n disabled?: boolean;\n /** Enabled a tooltip that gives more info on why the field is disabled */\n disabledReason?: string;\n renderContent?: () => ReactNode;\n options?: IRadioButtonOption<TValue>[];\n}\n\nexport interface IRadioButtonGroupProps<TValue extends string = string> {\n options?: IRadioButtonOption<TValue>[];\n value?: TValue;\n onChange?: (value: TValue, optionValue?: TValue) => void;\n renderChildrenContent?: boolean;\n isSubGroup?: boolean;\n}\n\nconst Option = <TValue extends string = string>({\n option: optionProp,\n value: valueProp,\n onChange,\n renderChildrenContent,\n isSubOption,\n}: {\n option: IRadioButtonOption<TValue>;\n value?: TValue;\n onChange?: (value: TValue, optionValue?: TValue) => void;\n renderChildrenContent?: boolean;\n isSubOption?: boolean;\n}): JSX.Element => {\n const options = optionProp.options;\n const isGroup = !!options?.length;\n const [ref, setRef] = useState<HTMLDivElement | null>(null);\n const [open, setOpen] = useState<boolean>(false);\n const option: IRadioButtonOption<TValue> | undefined = isGroup && valueProp ? options.find(({ value }) => value === valueProp) || optionProp : optionProp;\n const radioButton = (\n <RadioButton\n headerRef={setRef}\n className={styles.item}\n key={option?.value}\n checked={!option?.disabled && option?.value === valueProp}\n onChange={() => {\n if (option?.disabled) return;\n if (isGroup) setOpen(!open);\n else if (option?.value && option?.value !== valueProp) onChange?.(option.value, optionProp.value);\n }}\n label={option?.label}\n disabled={option?.disabled}\n renderContent={option?.renderContent}\n />\n );\n\n const isSelected = !isGroup && option?.value === valueProp;\n const isExpanded = isGroup && open;\n const dropDownIndicatorStyle: React.CSSProperties | undefined =\n !option?.renderContent && !isGroup\n ? { transform: 'translateX(1px) translateY(-2px) rotate(270deg)' }\n : isSelected || isExpanded\n ? { transform: 'scaleY(-1) translateY(2px)' }\n : undefined;\n\n if (option?.disabled && option?.disabledReason) {\n return (\n <Tooltip key={option?.value} wrapperClasses={styles.wrapper} title={option?.disabledReason}>\n {radioButton}\n </Tooltip>\n );\n }\n\n return (\n <>\n <div key={option?.value} className={styles.wrapper}>\n {radioButton}\n {!isSubOption && (\n <div className={styles.childrenIndicator} style={dropDownIndicatorStyle}>\n <Icon size=\"24px\" icon={IconType.Dropdown} />\n </div>\n )}\n </div>\n {options && (\n <Overlay\n onClose={() => setOpen(false)}\n className={styles.overlay}\n hideStyles\n containerClassName=\"u-w-100\"\n open={open}\n followElement={ref || undefined}\n offset={[0, 0]}\n placement=\"bottom-start\"\n >\n <RadioButtonGroup\n options={options.map((option) => {\n const { renderContent, ...rest } = option;\n if (!renderChildrenContent) return rest;\n return option;\n })}\n onChange={(subValue) => {\n onChange?.(optionProp.value, subValue);\n setOpen(false);\n }}\n value={valueProp}\n isSubGroup\n />\n </Overlay>\n )}\n </>\n );\n};\n\nconst RadioButtonGroup = <TValue extends string = string>({\n options = [],\n value: valueProp,\n onChange,\n renderChildrenContent,\n isSubGroup,\n}: IRadioButtonGroupProps<TValue>): ReactElement | null => {\n return (\n <div className={styles.root}>\n {options.map((rawOption) => (\n <Option key={rawOption.value} option={rawOption} value={valueProp} onChange={onChange} renderChildrenContent={renderChildrenContent} isSubOption={isSubGroup} />\n ))}\n </div>\n );\n};\n\nexport default RadioButtonGroup;\n"]}
|
|
@@ -30,8 +30,9 @@ export type SelectProps<TOption extends Option<KeyName>, KeyName extends string>
|
|
|
30
30
|
hideExpandIcon?: boolean;
|
|
31
31
|
inputLabelColor?: Color;
|
|
32
32
|
disableNative?: boolean;
|
|
33
|
+
renderNoOptions?: (targetRef: React.RefObject<HTMLSpanElement>) => ReactElement | null;
|
|
33
34
|
};
|
|
34
|
-
export declare const InnerSelect: <TOption extends Option<KeyName>, KeyName extends string>({ target, open, onClose, options, value, onChange, keyName, labelName, className, offset, renderOption, nativeOnMobile, overlay, renderLabel, hideExpandIcon, inputLabelColor, disableNative, }: SelectProps<TOption, KeyName>, ref: Ref<HTMLDivElement | null>) => JSX.Element;
|
|
35
|
+
export declare const InnerSelect: <TOption extends Option<KeyName>, KeyName extends string>({ target, open, onClose, options, value, onChange, keyName, labelName, className, offset, renderOption, nativeOnMobile, overlay, renderLabel, hideExpandIcon, inputLabelColor, disableNative, renderNoOptions, }: SelectProps<TOption, KeyName>, ref: Ref<HTMLDivElement | null>) => JSX.Element;
|
|
35
36
|
export declare const Select: <TOption extends Option<KeyName>, KeyName extends string>(p: SelectProps<TOption, KeyName> & {
|
|
36
37
|
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
37
38
|
}) => JSX.Element;
|
|
@@ -38,7 +38,7 @@ const WindowSize_1 = require("../../../hooks/WindowSize");
|
|
|
38
38
|
const Color_1 = require("../../../util/Color");
|
|
39
39
|
const Icon_1 = __importStar(require("../Icon/Icon"));
|
|
40
40
|
const MOBILE_BREAKPOINT = 992;
|
|
41
|
-
const InnerSelect = ({ target, open, onClose, options = [], value, onChange, keyName, labelName, className, offset, renderOption, nativeOnMobile = false, overlay, renderLabel, hideExpandIcon, inputLabelColor, disableNative, }, ref) => {
|
|
41
|
+
const InnerSelect = ({ target, open, onClose, options = [], value, onChange, keyName, labelName, className, offset, renderOption, nativeOnMobile = false, overlay, renderLabel, hideExpandIcon, inputLabelColor, disableNative, renderNoOptions, }, ref) => {
|
|
42
42
|
var _a, _b;
|
|
43
43
|
const { width } = (0, WindowSize_1.useWindowSize)();
|
|
44
44
|
const targetRef = (0, react_1.useRef)(null);
|
|
@@ -141,7 +141,7 @@ const InnerSelect = ({ target, open, onClose, options = [], value, onChange, key
|
|
|
141
141
|
}))) : (_getLabel(value)),
|
|
142
142
|
hideExpandIcon ? null : react_1.default.createElement(Icon_1.default, { icon: Icon_1.IconType.Dropdown, color: Color_1.Color.DarkGrey }))),
|
|
143
143
|
!native && (react_1.default.createElement(Overlay_1.Overlay, { offset: offset, usePortal: (_a = overlay === null || overlay === void 0 ? void 0 : overlay.usePortal) !== null && _a !== void 0 ? _a : true, followElement: target || targetRef.current || undefined, placement: (_b = overlay === null || overlay === void 0 ? void 0 : overlay.placement) !== null && _b !== void 0 ? _b : 'bottom-start', strategy: overlay === null || overlay === void 0 ? void 0 : overlay.strategy, open: open === undefined ? !!_open : open, onClose: _onClose, containerClassName: overlay === null || overlay === void 0 ? void 0 : overlay.containerClassName, overlayRef: overlayRef, hideStyles: overlay === null || overlay === void 0 ? void 0 : overlay.hideStyles },
|
|
144
|
-
react_1.default.createElement("div", { ref: optionContainerRef, className: (0, classnames_1.default)('rs-select--suggest-list', overlay === null || overlay === void 0 ? void 0 : overlay.className) }, _renderOptions(options))))));
|
|
144
|
+
react_1.default.createElement("div", { ref: optionContainerRef, className: (0, classnames_1.default)('rs-select--suggest-list', overlay === null || overlay === void 0 ? void 0 : overlay.className) }, options.length ? _renderOptions(options) : react_1.default.createElement("div", { className: "rs-select--suggest-list-item" }, renderNoOptions === null || renderNoOptions === void 0 ? void 0 : renderNoOptions(targetRef)))))));
|
|
145
145
|
};
|
|
146
146
|
exports.InnerSelect = InnerSelect;
|
|
147
147
|
exports.Select = (0, react_1.forwardRef)(exports.InnerSelect);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"/","sources":["src/components/generic/Select/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gCAA8B;AAE9B,4DAAoC;AACpC,+CAA8G;AAE9G,kEAA6E;AAC7E,kEAA2D;AAC3D,uDAAwD;AACxD,6EAA6E;AAC7E,mDAAmD;AACnD,wCAAqC;AAErC,qDAA8C;AAmC9C,MAAM,iBAAiB,G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CAAI,cAAc,EAC/C,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAC3B,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACzC,OAAO,EAAE,QAAQ,EACjB,kBAAkB,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,kBAAkB,EAC/C,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU;YAE/B,uCAAK,GAAG,EAAE,kBAAkB,EAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,yBAAyB,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAC,IAC7F,cAAc,CAAC,OAAO,CAAC,CACtB,CACA,CACb,CACF,CACN,CAAC;AACN,CAAC,CAAC;AA/LW,QAAA,WAAW,eA+LtB;AAEW,QAAA,MAAM,GAAG,IAAA,kBAAU,EAAC,mBAAW,CAE5B,CAAC","sourcesContent":["import './Select.global.scss';\n\nimport classNames from 'classnames';\nimport React, { forwardRef, ReactElement, ReactNode, Ref, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport { Overlay, OverlayProps } from '@/components/generic/Overlay/Overlay';\nimport Text, { TextType } from '@/components/generic/Text';\nimport { useCombinedState } from '@/hooks/CombineState';\nimport { useKeyboardControlOnSelect } from '@/hooks/KeyboardControlOnSelect';\nimport { useWindowSize } from '@/hooks/WindowSize';\nimport { Color } from '@/util/Color';\n\nimport Icon, { IconType } from '../Icon/Icon';\n\nexport type Option<KeyName extends string> = {\n [keyName in KeyName]: string;\n} & Record<any, any> & { options?: Option<KeyName>[] };\n\nexport type TOptionGroup<T> = {\n name: string;\n options: T[];\n};\n\nexport type TSelectOptionKey<T> = TOptionGroup<T> | T;\n\nexport type SelectProps<TOption extends Option<KeyName>, KeyName extends string> = {\n options: TSelectOptionKey<TOption>[];\n keyName: KeyName;\n\n value?: TOption[KeyName];\n labelName?: TOption[keyof TOption];\n target?: HTMLElement | null;\n open?: boolean;\n onClose?: (e: Event) => void;\n onChange?: (value: TOption[KeyName]) => void;\n className?: string;\n offset?: [number, number];\n renderOption?: (option?: TOption) => ReactElement | null;\n renderLabel?: (option?: TOption | null) => ReactElement | null;\n nativeOnMobile?: boolean;\n overlay?: Partial<Omit<OverlayProps, 'children' | 'open' | 'container' | 'followElement' | 'onClose' | 'overlayRef'>>;\n hideExpandIcon?: boolean;\n\n inputLabelColor?: Color;\n disableNative?: boolean;\n};\n\nconst MOBILE_BREAKPOINT = 992;\n\nexport const InnerSelect = <TOption extends Option<KeyName>, KeyName extends string>(\n {\n target,\n open,\n onClose,\n options = [],\n value,\n onChange,\n keyName,\n labelName,\n className,\n offset,\n renderOption,\n nativeOnMobile = false,\n overlay,\n renderLabel,\n hideExpandIcon,\n inputLabelColor,\n disableNative,\n }: SelectProps<TOption, KeyName>,\n ref: Ref<HTMLDivElement | null>\n) => {\n const { width } = useWindowSize();\n const targetRef = useRef<HTMLSpanElement>(null);\n const optionRefs = useRef<{ [id: string]: HTMLDivElement | null }>({});\n const optionContainerRef = useRef<HTMLDivElement | null>(null);\n const [_open, _setIsOpen] = useCombinedState<boolean>(open, false);\n const flattenOptions = useMemo<TOption[]>(() => {\n return options.reduce<TOption[]>((result, optionGroupProbably) => {\n if (optionGroupProbably.options) return result.concat(optionGroupProbably.options);\n return result.concat(optionGroupProbably as TOption);\n }, []);\n }, [options]);\n\n // TODO: Force to fix later\n nativeOnMobile = false;\n\n const _onClose = (e: Event): void => {\n _setIsOpen(false);\n onClose?.(e);\n };\n\n const overlayRef = useRef<HTMLDivElement | null>(null);\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(ref, () => overlayRef.current);\n\n const _onSelected = (value: TOption[KeyName]) => {\n onChange?.(value);\n _setIsOpen(false);\n };\n\n const _getOption = (value?: TOption[KeyName]): TOption | undefined => {\n for (const option of options) {\n if (option.options && Array.isArray(option.options)) {\n for (const childOption of option.options) {\n if (childOption[keyName] === value) {\n return childOption;\n }\n }\n } else {\n // If we're in here it means that this option doesn't have children and is in fact an individual group\n if ((option as TOption)[keyName] === value) {\n return option as TOption;\n }\n }\n }\n };\n\n const { selectingItem, onItemMouseMove, onItemMouseLeave, onItemMouseEnter } = useKeyboardControlOnSelect<TOption, KeyName>({\n onSelected: (item) => _onSelected(item[keyName]),\n isEnabled: !!_open,\n options,\n idName: keyName,\n overlayRef: overlayRef.current,\n defaultOption: _getOption(value),\n optionRefs,\n optionContainerRef,\n });\n\n const _getStringLabel = (value?: TOption[KeyName]): string => {\n const option = _getOption(value);\n return option?.[labelName] || value || '';\n };\n\n const _getLabel = (value?: TOption[KeyName]): string | ReactNode => {\n const option = _getOption(value);\n\n if (renderLabel) {\n return renderLabel(option);\n }\n\n return _getStringLabel(value);\n };\n\n const _renderOptions = (options?: TSelectOptionKey<TOption>[]): ReactElement | JSX.Element[] | null => {\n if (!options) return null;\n return options.map((option, index) => {\n const isGroup = option.options;\n\n if (isGroup) {\n return _renderGroup(option.name, option.options);\n }\n\n return _renderOption({ option: option as TOption, key: index });\n });\n };\n\n const _renderGroup = (name: string, options?: TSelectOptionKey<TOption>[]) => {\n return (\n <>\n <div className=\"rs-select--suggest-list-item --group-title\">\n <Text type={TextType.Small} color={Color.DarkGrey}>\n {name}\n </Text>\n </div>\n {_renderOptions(options)}\n </>\n );\n };\n\n const _renderOption = ({ option, key }: { option: TOption; key: any }) => {\n const isSelected = option[keyName] === value;\n const isSelecting = option[keyName] === selectingItem?.[keyName];\n\n return (\n <div\n ref={(ref) => (optionRefs.current[option[keyName]] = ref)}\n key={key}\n className={classNames('rs-select--suggest-list-item', { '--selected': isSelected || isSelecting })}\n onClick={() => _onSelected(option[keyName])}\n onMouseEnter={() => {\n onItemMouseEnter(option);\n }}\n onMouseLeave={() => onItemMouseLeave()}\n onMouseMove={() => onItemMouseMove()}\n >\n <Text type={TextType.Small} className=\"rs-select--suggest-list-option-name\">\n {renderOption ? renderOption(option) : labelName ? option[labelName] : ''}\n </Text>\n {isSelected && (\n <span className=\"rs-select--suggest-list-option-icon\">\n <Icon icon={IconType.Check} />\n </span>\n )}\n </div>\n );\n };\n\n const native = width && width < MOBILE_BREAKPOINT && nativeOnMobile;\n\n const labelProps: any = {};\n\n if (inputLabelColor) {\n labelProps.style = { color: inputLabelColor };\n }\n\n return (\n <>\n {(native || !target || disableNative) && (\n <span className={classNames('be-select', className)} onClick={() => _setIsOpen(true)} ref={targetRef} {...labelProps}>\n {native ? (\n <select value={value} onChange={(e) => onChange?.(e.target.value as TOption[KeyName])}>\n {flattenOptions.map((item) => {\n return <option value={value} key={item[keyName]} label={_getStringLabel(item[keyName])}></option>;\n })}\n </select>\n ) : (\n _getLabel(value)\n )}\n {hideExpandIcon ? null : <Icon icon={IconType.Dropdown} color={Color.DarkGrey} />}\n </span>\n )}\n {!native && (\n <Overlay\n offset={offset}\n usePortal={overlay?.usePortal ?? true}\n followElement={target || targetRef.current || undefined}\n placement={overlay?.placement ?? 'bottom-start'}\n strategy={overlay?.strategy}\n open={open === undefined ? !!_open : open}\n onClose={_onClose}\n containerClassName={overlay?.containerClassName}\n overlayRef={overlayRef}\n hideStyles={overlay?.hideStyles}\n >\n <div ref={optionContainerRef} className={classNames('rs-select--suggest-list', overlay?.className)}>\n {_renderOptions(options)}\n </div>\n </Overlay>\n )}\n </>\n );\n};\n\nexport const Select = forwardRef(InnerSelect) as <TOption extends Option<KeyName>, KeyName extends string>(\n p: SelectProps<TOption, KeyName> & { ref?: Ref<HTMLDivElement> }\n) => JSX.Element;\n\nexport interface IDefaultSelectOption {\n value: string;\n text: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"/","sources":["src/components/generic/Select/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gCAA8B;AAE9B,4DAAoC;AACpC,+CAA8G;AAE9G,kEAA6E;AAC7E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a,EAAE,MAAM,IAAI,SAAS,CAAC,OAAO,IAAI,SAAS,EACvD,SAAS,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,mCAAI,cAAc,EAC/C,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,EAC3B,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACzC,OAAO,EAAE,QAAQ,EACjB,kBAAkB,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,kBAAkB,EAC/C,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU;YAE/B,uCAAK,GAAG,EAAE,kBAAkB,EAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,yBAAyB,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAC,IAC7F,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,uCAAK,SAAS,EAAC,8BAA8B,IAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAG,SAAS,CAAC,CAAO,CAC5H,CACA,CACb,CACF,CACN,CAAC;AACN,CAAC,CAAC;AAhMW,QAAA,WAAW,eAgMtB;AAEW,QAAA,MAAM,GAAG,IAAA,kBAAU,EAAC,mBAAW,CAE5B,CAAC","sourcesContent":["import './Select.global.scss';\n\nimport classNames from 'classnames';\nimport React, { forwardRef, ReactElement, ReactNode, Ref, useImperativeHandle, useMemo, useRef } from 'react';\n\nimport { Overlay, OverlayProps } from '@/components/generic/Overlay/Overlay';\nimport Text, { TextType } from '@/components/generic/Text';\nimport { useCombinedState } from '@/hooks/CombineState';\nimport { useKeyboardControlOnSelect } from '@/hooks/KeyboardControlOnSelect';\nimport { useWindowSize } from '@/hooks/WindowSize';\nimport { Color } from '@/util/Color';\n\nimport Icon, { IconType } from '../Icon/Icon';\n\nexport type Option<KeyName extends string> = {\n [keyName in KeyName]: string;\n} & Record<any, any> & { options?: Option<KeyName>[] };\n\nexport type TOptionGroup<T> = {\n name: string;\n options: T[];\n};\n\nexport type TSelectOptionKey<T> = TOptionGroup<T> | T;\n\nexport type SelectProps<TOption extends Option<KeyName>, KeyName extends string> = {\n options: TSelectOptionKey<TOption>[];\n keyName: KeyName;\n\n value?: TOption[KeyName];\n labelName?: TOption[keyof TOption];\n target?: HTMLElement | null;\n open?: boolean;\n onClose?: (e: Event) => void;\n onChange?: (value: TOption[KeyName]) => void;\n className?: string;\n offset?: [number, number];\n renderOption?: (option?: TOption) => ReactElement | null;\n renderLabel?: (option?: TOption | null) => ReactElement | null;\n nativeOnMobile?: boolean;\n overlay?: Partial<Omit<OverlayProps, 'children' | 'open' | 'container' | 'followElement' | 'onClose' | 'overlayRef'>>;\n hideExpandIcon?: boolean;\n\n inputLabelColor?: Color;\n disableNative?: boolean;\n renderNoOptions?: (targetRef: React.RefObject<HTMLSpanElement>) => ReactElement | null;\n};\n\nconst MOBILE_BREAKPOINT = 992;\n\nexport const InnerSelect = <TOption extends Option<KeyName>, KeyName extends string>(\n {\n target,\n open,\n onClose,\n options = [],\n value,\n onChange,\n keyName,\n labelName,\n className,\n offset,\n renderOption,\n nativeOnMobile = false,\n overlay,\n renderLabel,\n hideExpandIcon,\n inputLabelColor,\n disableNative,\n renderNoOptions,\n }: SelectProps<TOption, KeyName>,\n ref: Ref<HTMLDivElement | null>\n) => {\n const { width } = useWindowSize();\n const targetRef = useRef<HTMLSpanElement>(null);\n const optionRefs = useRef<{ [id: string]: HTMLDivElement | null }>({});\n const optionContainerRef = useRef<HTMLDivElement | null>(null);\n const [_open, _setIsOpen] = useCombinedState<boolean>(open, false);\n const flattenOptions = useMemo<TOption[]>(() => {\n return options.reduce<TOption[]>((result, optionGroupProbably) => {\n if (optionGroupProbably.options) return result.concat(optionGroupProbably.options);\n return result.concat(optionGroupProbably as TOption);\n }, []);\n }, [options]);\n\n // TODO: Force to fix later\n nativeOnMobile = false;\n\n const _onClose = (e: Event): void => {\n _setIsOpen(false);\n onClose?.(e);\n };\n\n const overlayRef = useRef<HTMLDivElement | null>(null);\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(ref, () => overlayRef.current);\n\n const _onSelected = (value: TOption[KeyName]) => {\n onChange?.(value);\n _setIsOpen(false);\n };\n\n const _getOption = (value?: TOption[KeyName]): TOption | undefined => {\n for (const option of options) {\n if (option.options && Array.isArray(option.options)) {\n for (const childOption of option.options) {\n if (childOption[keyName] === value) {\n return childOption;\n }\n }\n } else {\n // If we're in here it means that this option doesn't have children and is in fact an individual group\n if ((option as TOption)[keyName] === value) {\n return option as TOption;\n }\n }\n }\n };\n\n const { selectingItem, onItemMouseMove, onItemMouseLeave, onItemMouseEnter } = useKeyboardControlOnSelect<TOption, KeyName>({\n onSelected: (item) => _onSelected(item[keyName]),\n isEnabled: !!_open,\n options,\n idName: keyName,\n overlayRef: overlayRef.current,\n defaultOption: _getOption(value),\n optionRefs,\n optionContainerRef,\n });\n\n const _getStringLabel = (value?: TOption[KeyName]): string => {\n const option = _getOption(value);\n return option?.[labelName] || value || '';\n };\n\n const _getLabel = (value?: TOption[KeyName]): string | ReactNode => {\n const option = _getOption(value);\n\n if (renderLabel) {\n return renderLabel(option);\n }\n\n return _getStringLabel(value);\n };\n\n const _renderOptions = (options?: TSelectOptionKey<TOption>[]): ReactElement | JSX.Element[] | null => {\n if (!options) return null;\n return options.map((option, index) => {\n const isGroup = option.options;\n\n if (isGroup) {\n return _renderGroup(option.name, option.options);\n }\n\n return _renderOption({ option: option as TOption, key: index });\n });\n };\n\n const _renderGroup = (name: string, options?: TSelectOptionKey<TOption>[]) => {\n return (\n <>\n <div className=\"rs-select--suggest-list-item --group-title\">\n <Text type={TextType.Small} color={Color.DarkGrey}>\n {name}\n </Text>\n </div>\n {_renderOptions(options)}\n </>\n );\n };\n\n const _renderOption = ({ option, key }: { option: TOption; key: any }) => {\n const isSelected = option[keyName] === value;\n const isSelecting = option[keyName] === selectingItem?.[keyName];\n\n return (\n <div\n ref={(ref) => (optionRefs.current[option[keyName]] = ref)}\n key={key}\n className={classNames('rs-select--suggest-list-item', { '--selected': isSelected || isSelecting })}\n onClick={() => _onSelected(option[keyName])}\n onMouseEnter={() => {\n onItemMouseEnter(option);\n }}\n onMouseLeave={() => onItemMouseLeave()}\n onMouseMove={() => onItemMouseMove()}\n >\n <Text type={TextType.Small} className=\"rs-select--suggest-list-option-name\">\n {renderOption ? renderOption(option) : labelName ? option[labelName] : ''}\n </Text>\n {isSelected && (\n <span className=\"rs-select--suggest-list-option-icon\">\n <Icon icon={IconType.Check} />\n </span>\n )}\n </div>\n );\n };\n\n const native = width && width < MOBILE_BREAKPOINT && nativeOnMobile;\n\n const labelProps: any = {};\n\n if (inputLabelColor) {\n labelProps.style = { color: inputLabelColor };\n }\n\n return (\n <>\n {(native || !target || disableNative) && (\n <span className={classNames('be-select', className)} onClick={() => _setIsOpen(true)} ref={targetRef} {...labelProps}>\n {native ? (\n <select value={value} onChange={(e) => onChange?.(e.target.value as TOption[KeyName])}>\n {flattenOptions.map((item) => {\n return <option value={value} key={item[keyName]} label={_getStringLabel(item[keyName])}></option>;\n })}\n </select>\n ) : (\n _getLabel(value)\n )}\n {hideExpandIcon ? null : <Icon icon={IconType.Dropdown} color={Color.DarkGrey} />}\n </span>\n )}\n {!native && (\n <Overlay\n offset={offset}\n usePortal={overlay?.usePortal ?? true}\n followElement={target || targetRef.current || undefined}\n placement={overlay?.placement ?? 'bottom-start'}\n strategy={overlay?.strategy}\n open={open === undefined ? !!_open : open}\n onClose={_onClose}\n containerClassName={overlay?.containerClassName}\n overlayRef={overlayRef}\n hideStyles={overlay?.hideStyles}\n >\n <div ref={optionContainerRef} className={classNames('rs-select--suggest-list', overlay?.className)}>\n {options.length ? _renderOptions(options) : <div className=\"rs-select--suggest-list-item\">{renderNoOptions?.(targetRef)}</div>}\n </div>\n </Overlay>\n )}\n </>\n );\n};\n\nexport const Select = forwardRef(InnerSelect) as <TOption extends Option<KeyName>, KeyName extends string>(\n p: SelectProps<TOption, KeyName> & { ref?: Ref<HTMLDivElement> }\n) => JSX.Element;\n\nexport interface IDefaultSelectOption {\n value: string;\n text: string;\n}\n"]}
|
|
@@ -42,18 +42,19 @@ function StepConfirmationAcknowledgement() {
|
|
|
42
42
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
43
43
|
const { hotel } = (0, hooks_1.useCurrentHotel)();
|
|
44
44
|
const { register, formState } = (0, react_hook_form_1.useFormContext)();
|
|
45
|
-
return (react_1.default.createElement(
|
|
46
|
-
react_1.default.createElement("div", { className: "u-marg-bottom" },
|
|
45
|
+
return (react_1.default.createElement("div", { className: "rs-step-confirmation-acks" },
|
|
46
|
+
react_1.default.createElement("div", { className: "u-marg-bottom rs-step-confirmation-acks-headline" },
|
|
47
47
|
react_1.default.createElement(Headline_1.default, { bold: true }, t(Translation_1.Translation.Step.Confirmation.Acknowledgement))),
|
|
48
|
-
react_1.default.createElement("div",
|
|
49
|
-
react_1.default.createElement(
|
|
50
|
-
|
|
51
|
-
react_1.default.createElement(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
react_1.default.createElement("div", { className: "rs-confirmation-acks-checklist" },
|
|
49
|
+
react_1.default.createElement("div", null,
|
|
50
|
+
react_1.default.createElement(Checkbox_1.default, Object.assign({ label: t(Translation_1.Translation.Step.Confirmation.EmailSpecialOffers) }, register('marketingOptIn', {})))),
|
|
51
|
+
react_1.default.createElement("div", { className: "u-marg-top--light" },
|
|
52
|
+
react_1.default.createElement(Checkbox_1.default, Object.assign({}, register('privacyPolicy', { required: true }), { label: react_1.default.createElement("div", null,
|
|
53
|
+
t(Translation_1.Translation.Step.Confirmation.IHaveUnderstoodPrivacyPolicy),
|
|
54
|
+
' ',
|
|
55
|
+
react_1.default.createElement("a", { style: { color: Color_1.Color.Accent }, className: "--underlined", href: hotel === null || hotel === void 0 ? void 0 : hotel.privacyPolicyUrl, target: "_blank", rel: "noreferrer" }, t(Translation_1.Translation.Step.Confirmation.PrivacyPolicy))) })))),
|
|
55
56
|
react_1.default.createElement(AutoAutoHeight_1.default, { open: !!formState.errors['privacyPolicy'] },
|
|
56
|
-
react_1.default.createElement("div", { className: "u-flex u-marg-top" },
|
|
57
|
+
react_1.default.createElement("div", { className: "u-flex u-marg-top rs-confirmation-acks-alert" },
|
|
57
58
|
react_1.default.createElement(Alert_1.default, { type: Alert_1.AlertType.Danger, icon: Icon_1.IconType.Error },
|
|
58
59
|
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small }, t(Translation_1.Translation.Step.Confirmation.PrivacyPolicyError)))))));
|
|
59
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepConfirmationAcknowledgement.js","sourceRoot":"/","sources":["src/components/steps/confirmation/StepConfirmationAcknowledgement.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAkD;AAClD,kDAA0B;AAC1B,qDAAiD;AACjD,iDAA+C;AAE/C,iFAAyD;AACzD,oEAA8D;AAC9D,sFAA8D;AAC9D,6EAAqD;AACrD,yDAA0D;AAC1D,kEAA2D;AAE3D,4DAAyD;AACzD,wCAAqC;AAErC,SAAwB,+BAA+B;IACnD,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAE/B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,uBAAe,GAAE,CAAC;IACpC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAA,gCAAc,GAA0B,CAAC;IAEzE,OAAO,CACH;
|
|
1
|
+
{"version":3,"file":"StepConfirmationAcknowledgement.js","sourceRoot":"/","sources":["src/components/steps/confirmation/StepConfirmationAcknowledgement.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAkD;AAClD,kDAA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AAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAC/C,CACF,IAEZ,CACA,CACJ;QACN,8BAAC,wBAAc,IAAC,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC;YACrD,uCAAK,SAAS,EAAC,8CAA8C;gBACzD,8BAAC,eAAK,IAAC,IAAI,EAAE,iBAAS,CAAC,MAAM,EAAE,IAAI,EAAE,eAAQ,CAAC,KAAK;oBAC/C,8BAAC,cAAI,IAAC,IAAI,EAAE,eAAQ,CAAC,KAAK,IAAG,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAQ,CACpF,CACN,CACO,CACf,CACT,CAAC;AACN,CAAC;AAtCD,kDAsCC","sourcesContent":["import { useCurrentHotel } from '@frontend/hooks';\nimport React from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\n\nimport AutoAutoHeight from '@/animations/AutoAutoHeight';\nimport Alert, { AlertType } from '@/components/generic/Alert';\nimport Checkbox from '@/components/generic/Checkbox/Checkbox';\nimport Headline from '@/components/generic/Headline';\nimport { IconType } from '@/components/generic/Icon/Icon';\nimport Text, { TextType } from '@/components/generic/Text';\nimport { ConfirmationFormValues } from '@/models/Confirmation';\nimport { Translation } from '@/translations/Translation';\nimport { Color } from '@/util/Color';\n\nexport default function StepConfirmationAcknowledgement() {\n const { t } = useTranslation();\n\n const { hotel } = useCurrentHotel();\n const { register, formState } = useFormContext<ConfirmationFormValues>();\n\n return (\n <div className=\"rs-step-confirmation-acks\">\n <div className=\"u-marg-bottom rs-step-confirmation-acks-headline\">\n <Headline bold>{t(Translation.Step.Confirmation.Acknowledgement)}</Headline>\n </div>\n <div className=\"rs-confirmation-acks-checklist\">\n <div>\n <Checkbox label={t(Translation.Step.Confirmation.EmailSpecialOffers)} {...register('marketingOptIn', {})} />\n </div>\n <div className=\"u-marg-top--light\">\n <Checkbox\n {...register('privacyPolicy', { required: true })}\n label={\n <div>\n {t(Translation.Step.Confirmation.IHaveUnderstoodPrivacyPolicy)}{' '}\n <a style={{ color: Color.Accent }} className=\"--underlined\" href={hotel?.privacyPolicyUrl} target=\"_blank\" rel=\"noreferrer\">\n {t(Translation.Step.Confirmation.PrivacyPolicy)}\n </a>\n </div>\n }\n />\n </div>\n </div>\n <AutoAutoHeight open={!!formState.errors['privacyPolicy']}>\n <div className=\"u-flex u-marg-top rs-confirmation-acks-alert\">\n <Alert type={AlertType.Danger} icon={IconType.Error}>\n <Text type={TextType.Small}>{t(Translation.Step.Confirmation.PrivacyPolicyError)}</Text>\n </Alert>\n </div>\n </AutoAutoHeight>\n </div>\n );\n}\n"]}
|
|
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
const ConfirmationStepContext_1 = require("contexts/ConfirmationStepContext/ConfirmationStepContext");
|
|
39
39
|
const HistoryConsistentPush_1 = require("hooks/HistoryConsistentPush");
|
|
40
|
-
const react_1 =
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
41
|
const react_hook_form_1 = require("react-hook-form");
|
|
42
42
|
const react_i18next_1 = require("react-i18next");
|
|
43
43
|
const Translation_1 = require("translations/Translation");
|
|
@@ -56,15 +56,19 @@ const PaymentInformation_1 = __importDefault(require("./PaymentInformation"));
|
|
|
56
56
|
const RoomContactDetails_1 = __importDefault(require("./RoomContactDetails"));
|
|
57
57
|
const StepConfirmationAcknowledgement_1 = __importDefault(require("./StepConfirmationAcknowledgement"));
|
|
58
58
|
const StepConfirmationCommentsComponent_1 = require("./StepConfirmationCommentsComponent");
|
|
59
|
+
const StepConfirmationImportantInformation_1 = __importDefault(require("./StepConfirmationImportantInformation"));
|
|
59
60
|
const StepConfirmationPoliciesSection_1 = __importDefault(require("./StepConfirmationPoliciesSection"));
|
|
60
61
|
const StepConfirmationPolicyBlock_1 = __importDefault(require("./StepConfirmationPolicyBlock"));
|
|
62
|
+
const ConfirmationImportantInformationFeature_1 = __importDefault(require("../../../providers/feature/ConfirmationImportantInformationFeature"));
|
|
61
63
|
const ConfirmationVerifyFeature_1 = __importDefault(require("../../../providers/feature/ConfirmationVerifyFeature"));
|
|
62
64
|
const ShowIATANumberOnCheckoutFeature_1 = __importDefault(require("../../../providers/feature/ShowIATANumberOnCheckoutFeature"));
|
|
63
65
|
const Color_1 = require("../../../util/Color");
|
|
64
66
|
const GetStepRoom_1 = __importDefault(require("../../../util/GetStepRoom"));
|
|
65
67
|
const usePaymentHelper_1 = require("../../../util/usePaymentHelper");
|
|
66
68
|
function StepConfirmationForm() {
|
|
67
|
-
var _a;
|
|
69
|
+
var _a, _b;
|
|
70
|
+
const [confirmationImportantInformationError, setConfirmationImportantInformationError] = (0, react_1.useState)(false);
|
|
71
|
+
const confirmationImportantInformation = (0, react_1.useRef)(null);
|
|
68
72
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
69
73
|
const methods = (0, react_hook_form_1.useFormContext)();
|
|
70
74
|
const { isInPaymentMode, isBackFromPlanpay, bookingSource } = (0, ConfirmationStepContext_1.useConfirmationStep)();
|
|
@@ -112,6 +116,9 @@ function StepConfirmationForm() {
|
|
|
112
116
|
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, color: Color_1.Color.Success },
|
|
113
117
|
react_1.default.createElement("strong", null, t(Translation_1.Translation.Step.Confirmation.Secured))))),
|
|
114
118
|
react_1.default.createElement(SSLSecureBadge_1.default, null))),
|
|
119
|
+
ConfirmationImportantInformationFeature_1.default.isActive() && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
120
|
+
react_1.default.createElement(LineBreak_1.default, null),
|
|
121
|
+
react_1.default.createElement(StepConfirmationImportantInformation_1.default, { ref: confirmationImportantInformation, confirmationError: confirmationImportantInformationError, withCheckbox: !!((_a = ConfirmationImportantInformationFeature_1.default.getOptions()) === null || _a === void 0 ? void 0 : _a.withCheckbox) }))),
|
|
115
122
|
react_1.default.createElement(LineBreak_1.default, null))),
|
|
116
123
|
react_1.default.createElement(StepConfirmationPoliciesSection_1.default, null),
|
|
117
124
|
react_1.default.createElement("div", { className: "u-pad-top--light u-marg-bottom" },
|
|
@@ -123,8 +130,8 @@ function StepConfirmationForm() {
|
|
|
123
130
|
return (react_1.default.createElement("form", null, isBackFromPlanpay ? (react_1.default.createElement(LargeLoader_1.default, null)) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
124
131
|
react_1.default.createElement(AutoAutoHeight_1.default, { open: !exclusivePayment || !isInPaymentMode }, prePaymentInfo),
|
|
125
132
|
exclusivePayment && (react_1.default.createElement(AutoAutoHeight_1.default, { open: isInPaymentMode },
|
|
126
|
-
react_1.default.createElement(ScrollToTop_1.default, null), (
|
|
127
|
-
|
|
133
|
+
react_1.default.createElement(ScrollToTop_1.default, null), (_b = exclusivePayment.renderPaymentInput) === null || _b === void 0 ? void 0 :
|
|
134
|
+
_b.call(exclusivePayment)))))));
|
|
128
135
|
}
|
|
129
136
|
exports.default = StepConfirmationForm;
|
|
130
137
|
//# sourceMappingURL=StepConfirmationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepConfirmationForm.js","sourceRoot":"/","sources":["src/components/steps/confirmation/StepConfirmationForm.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sGAA+F;AAC/F,uEAAuE;AACvE,kDAA0B;AAC1B,qDAAiD;AACjD,iDAA+C;AAC/C,0DAAuD;AAEvD,iFAAyD;AACzD,oEAA8D;AAC9D,iGAAyE;AACzE,6EAAqD;AACrD,6EAAqD;AACrD,uEAAgE;AAChE,+EAAuD;AACvD,0FAAkE;AAClE,mFAA2D;AAC3D,kEAA2D;AAC3D,2EAAmD;AACnD,4GAAoF;AACpF,4GAAoF;AACpF,sIAA8G;AAC9G,yHAAsH;AACtH,sIAA8G;AAC9G,8HAAsG;AAEtG,8GAAsF;AACtF,0HAAkG;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AgB,IAAI,CAAC,eAAe,IAAG,cAAc,CAAkB;QAC7F,gBAAgB,IAAI,CACjB,8BAAC,wBAAc,IAAC,IAAI,EAAE,eAAe;YACjC,8BAAC,qBAAW,OAAG,EACd,MAAA,gBAAgB,CAAC,kBAAkB;qCAAI,CAC3B,CACpB,CACF,CACN,CACE,CACV,CAAC;AACN,CAAC;AAzHD,uCAyHC","sourcesContent":["import { useConfirmationStep } from 'contexts/ConfirmationStepContext/ConfirmationStepContext';\nimport { useHistoryConsistentPush } from 'hooks/HistoryConsistentPush';\nimport React from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport AutoAutoHeight from '@/animations/AutoAutoHeight';\nimport Alert, { AlertType } from '@/components/generic/Alert';\nimport SSLSecureBadge from '@/components/generic/badging/SSLSecureBadge';\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport LineBreak from '@/components/generic/LineBreak';\nimport LargeLoader from '@/components/generic/loader/LargeLoader';\nimport ScrollToTop from '@/components/generic/ScrollToTop';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TextBox from '@/components/generic/TextBox';\nimport PaymentInformation from '@/components/steps/confirmation/PaymentInformation';\nimport RoomContactDetails from '@/components/steps/confirmation/RoomContactDetails';\nimport StepConfirmationAcknowledgement from '@/components/steps/confirmation/StepConfirmationAcknowledgement';\nimport { StepConfirmationCommentsComponent } from '@/components/steps/confirmation/StepConfirmationCommentsComponent';\nimport StepConfirmationPoliciesSection from '@/components/steps/confirmation/StepConfirmationPoliciesSection';\nimport StepConfirmationPolicyBlock from '@/components/steps/confirmation/StepConfirmationPolicyBlock';\nimport { ConfirmationFormValues } from '@/models/Confirmation';\nimport ConfirmationVerifyFeature from '@/providers/feature/ConfirmationVerifyFeature';\nimport ShowIATANumberOnCheckoutFeature from '@/providers/feature/ShowIATANumberOnCheckoutFeature';\nimport { Color } from '@/util/Color';\nimport getStepRoom from '@/util/GetStepRoom';\nimport { usePaymentHelper } from '@/util/usePaymentHelper';\n\nexport default function StepConfirmationForm() {\n const { t } = useTranslation();\n\n const methods = useFormContext<ConfirmationFormValues>();\n const { isInPaymentMode, isBackFromPlanpay, bookingSource } = useConfirmationStep();\n\n const historyConsistentPush = useHistoryConsistentPush();\n\n const { exclusivePayment } = usePaymentHelper();\n\n const returnToPickRooms = async () => {\n historyConsistentPush(getStepRoom().getStepUrl());\n };\n\n const prePaymentInfo = (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Headline bold>{t(Translation.Step.Confirmation.GuestDetails)}</Headline>\n </div>\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.AlmostDone, { required: '*' })}</strong>\n </Text>\n </div>\n <RoomContactDetails />\n {bookingSource === 'inline' ? (\n <Alert type={AlertType.Accent2} heavyPadding>\n <div className=\"u-flex u-w-100 flex-wrap flex-xl-nowrap\">\n <div>\n <Text color={Color.Accent} bold>\n {t(Translation.Step.Confirmation.WantMoreRooms)}\n </Text>\n <Text color={Color.Navy}>{t(Translation.Step.Confirmation.YouCanAddAndEditRooms)}</Text>\n </div>\n <div className=\"d-flex align-items-center u-marg-top@xl-\">\n <BEButton filled primary icon={IconType.Add} iconPosition=\"left\" onClick={returnToPickRooms}>\n {t(Translation.Step.Confirmation.AddMoreRooms)}\n </BEButton>\n </div>\n </div>\n </Alert>\n ) : (\n <></>\n )}\n {ShowIATANumberOnCheckoutFeature.isActive() && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Step.Confirmation.TravelAgent)}</Headline>\n </div>\n\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.Inputs.IATANumber)}</strong>\n </Text>\n </div>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>{t(Translation.Step.Confirmation.Inputs.IATANumberGuide)}</Text>\n </div>\n <TextBox placeholder={t(Translation.Step.Confirmation.Inputs.IATANumber)} wide {...methods.register('IATANumber')} />\n </div>\n <LineBreak />\n </>\n )}\n <StepConfirmationCommentsComponent />\n <LineBreak />\n {!exclusivePayment && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Navigation.Menu.PaymentInformation)}</Headline>\n </div>\n\n <PaymentInformation />\n <div className=\"u-marg-top u-flex align-items-center\">\n <div className=\"u-flex align-items-center justify-content-start\">\n <Icon icon={IconType.Lock} color={Color.Success} />\n <div className=\"u-marg-left--light\">\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.Secured)}</strong>\n </Text>\n </div>\n </div>\n <SSLSecureBadge />\n </div>\n </div>\n <LineBreak />\n </>\n )}\n <StepConfirmationPoliciesSection />\n <div className=\"u-pad-top--light u-marg-bottom\">\n <StepConfirmationPolicyBlock />\n </div>\n {ConfirmationVerifyFeature.isActive() && (\n <>\n <LineBreak />\n <div>\n <StepConfirmationAcknowledgement />\n </div>\n </>\n )}\n </>\n );\n\n return (\n <form>\n {isBackFromPlanpay ? (\n <LargeLoader />\n ) : (\n <>\n <AutoAutoHeight open={!exclusivePayment || !isInPaymentMode}>{prePaymentInfo}</AutoAutoHeight>\n {exclusivePayment && (\n <AutoAutoHeight open={isInPaymentMode}>\n <ScrollToTop />\n {exclusivePayment.renderPaymentInput?.()}\n </AutoAutoHeight>\n )}\n </>\n )}\n </form>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StepConfirmationForm.js","sourceRoot":"/","sources":["src/components/steps/confirmation/StepConfirmationForm.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sGAA+F;AAC/F,uEAAuE;AACvE,+CAAgD;AAChD,qDAAiD;AACjD,iDAA+C;AAC/C,0DAAuD;AAEvD,iF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ACJ;oBACN,8BAAC,wBAAc,OAAG,CAChB,CACJ;YACL,iDAAuC,CAAC,QAAQ,EAAE,IAAI,CACnD;gBACI,8BAAC,mBAAS,OAAG;gBACb,8BAAC,8CAAoC,IACjC,GAAG,EAAE,gCAAgC,EACrC,iBAAiB,EAAE,qCAAqC,EACxD,YAAY,EAAE,CAAC,CAAC,CAAA,MAAA,iDAAuC,CAAC,UAAU,EAAE,0CAAE,YAAY,CAAA,GACpF,CACH,CACN;YACD,8BAAC,mBAAS,OAAG,CACd,CACN;QACD,8BAAC,yCAA+B,OAAG;QACnC,uCAAK,SAAS,EAAC,gCAAgC;YAC3C,8BAAC,qCAA2B,OAAG,CAC7B;QACL,mCAAyB,CAAC,QAAQ,EAAE,IAAI,CACrC;YACI,8BAAC,mBAAS,OAAG;YACb;gBACI,8BAAC,yCAA+B,OAAG,CACjC,CACP,CACN,CACF,CACN,CAAC;IAEF,OAAO,CACH,4CACK,iBAAiB,CAAC,CAAC,CAAC,CACjB,8BAAC,qBAAW,OAAG,CAClB,CAAC,CAAC,CAAC,CACA;QACI,8BAAC,wBAAc,IAAC,IAAI,EAAE,CAAC,gBAAgB,IAAI,CAAC,eAAe,IAAG,cAAc,CAAkB;QAC7F,gBAAgB,IAAI,CACjB,8BAAC,wBAAc,IAAC,IAAI,EAAE,eAAe;YACjC,8BAAC,qBAAW,OAAG,EACd,MAAA,gBAAgB,CAAC,kBAAkB;qCAAI,CAC3B,CACpB,CACF,CACN,CACE,CACV,CAAC;AACN,CAAC;AArID,uCAqIC","sourcesContent":["import { useConfirmationStep } from 'contexts/ConfirmationStepContext/ConfirmationStepContext';\nimport { useHistoryConsistentPush } from 'hooks/HistoryConsistentPush';\nimport React, { useRef, useState } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport AutoAutoHeight from '@/animations/AutoAutoHeight';\nimport Alert, { AlertType } from '@/components/generic/Alert';\nimport SSLSecureBadge from '@/components/generic/badging/SSLSecureBadge';\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport LineBreak from '@/components/generic/LineBreak';\nimport LargeLoader from '@/components/generic/loader/LargeLoader';\nimport ScrollToTop from '@/components/generic/ScrollToTop';\nimport Text, { TextType } from '@/components/generic/Text';\nimport TextBox from '@/components/generic/TextBox';\nimport PaymentInformation from '@/components/steps/confirmation/PaymentInformation';\nimport RoomContactDetails from '@/components/steps/confirmation/RoomContactDetails';\nimport StepConfirmationAcknowledgement from '@/components/steps/confirmation/StepConfirmationAcknowledgement';\nimport { StepConfirmationCommentsComponent } from '@/components/steps/confirmation/StepConfirmationCommentsComponent';\nimport StepConfirmationImportantInformation from '@/components/steps/confirmation/StepConfirmationImportantInformation';\nimport StepConfirmationPoliciesSection from '@/components/steps/confirmation/StepConfirmationPoliciesSection';\nimport StepConfirmationPolicyBlock from '@/components/steps/confirmation/StepConfirmationPolicyBlock';\nimport { ConfirmationFormValues } from '@/models/Confirmation';\nimport ConfirmationImportantInformationFeature from '@/providers/feature/ConfirmationImportantInformationFeature';\nimport ConfirmationVerifyFeature from '@/providers/feature/ConfirmationVerifyFeature';\nimport ShowIATANumberOnCheckoutFeature from '@/providers/feature/ShowIATANumberOnCheckoutFeature';\nimport { Color } from '@/util/Color';\nimport getStepRoom from '@/util/GetStepRoom';\nimport { usePaymentHelper } from '@/util/usePaymentHelper';\n\nexport default function StepConfirmationForm() {\n const [confirmationImportantInformationError, setConfirmationImportantInformationError] = useState(false);\n const confirmationImportantInformation = useRef<HTMLInputElement | null>(null);\n const { t } = useTranslation();\n\n const methods = useFormContext<ConfirmationFormValues>();\n const { isInPaymentMode, isBackFromPlanpay, bookingSource } = useConfirmationStep();\n\n const historyConsistentPush = useHistoryConsistentPush();\n\n const { exclusivePayment } = usePaymentHelper();\n\n const returnToPickRooms = async () => {\n historyConsistentPush(getStepRoom().getStepUrl());\n };\n\n const prePaymentInfo = (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Headline bold>{t(Translation.Step.Confirmation.GuestDetails)}</Headline>\n </div>\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.AlmostDone, { required: '*' })}</strong>\n </Text>\n </div>\n <RoomContactDetails />\n {bookingSource === 'inline' ? (\n <Alert type={AlertType.Accent2} heavyPadding>\n <div className=\"u-flex u-w-100 flex-wrap flex-xl-nowrap\">\n <div>\n <Text color={Color.Accent} bold>\n {t(Translation.Step.Confirmation.WantMoreRooms)}\n </Text>\n <Text color={Color.Navy}>{t(Translation.Step.Confirmation.YouCanAddAndEditRooms)}</Text>\n </div>\n <div className=\"d-flex align-items-center u-marg-top@xl-\">\n <BEButton filled primary icon={IconType.Add} iconPosition=\"left\" onClick={returnToPickRooms}>\n {t(Translation.Step.Confirmation.AddMoreRooms)}\n </BEButton>\n </div>\n </div>\n </Alert>\n ) : (\n <></>\n )}\n {ShowIATANumberOnCheckoutFeature.isActive() && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Step.Confirmation.TravelAgent)}</Headline>\n </div>\n\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.Inputs.IATANumber)}</strong>\n </Text>\n </div>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>{t(Translation.Step.Confirmation.Inputs.IATANumberGuide)}</Text>\n </div>\n <TextBox placeholder={t(Translation.Step.Confirmation.Inputs.IATANumber)} wide {...methods.register('IATANumber')} />\n </div>\n <LineBreak />\n </>\n )}\n <StepConfirmationCommentsComponent />\n <LineBreak />\n {!exclusivePayment && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Navigation.Menu.PaymentInformation)}</Headline>\n </div>\n\n <PaymentInformation />\n <div className=\"u-marg-top u-flex align-items-center\">\n <div className=\"u-flex align-items-center justify-content-start\">\n <Icon icon={IconType.Lock} color={Color.Success} />\n <div className=\"u-marg-left--light\">\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.Secured)}</strong>\n </Text>\n </div>\n </div>\n <SSLSecureBadge />\n </div>\n </div>\n {ConfirmationImportantInformationFeature.isActive() && (\n <>\n <LineBreak />\n <StepConfirmationImportantInformation\n ref={confirmationImportantInformation}\n confirmationError={confirmationImportantInformationError}\n withCheckbox={!!ConfirmationImportantInformationFeature.getOptions()?.withCheckbox}\n />\n </>\n )}\n <LineBreak />\n </>\n )}\n <StepConfirmationPoliciesSection />\n <div className=\"u-pad-top--light u-marg-bottom\">\n <StepConfirmationPolicyBlock />\n </div>\n {ConfirmationVerifyFeature.isActive() && (\n <>\n <LineBreak />\n <div>\n <StepConfirmationAcknowledgement />\n </div>\n </>\n )}\n </>\n );\n\n return (\n <form>\n {isBackFromPlanpay ? (\n <LargeLoader />\n ) : (\n <>\n <AutoAutoHeight open={!exclusivePayment || !isInPaymentMode}>{prePaymentInfo}</AutoAutoHeight>\n {exclusivePayment && (\n <AutoAutoHeight open={isInPaymentMode}>\n <ScrollToTop />\n {exclusivePayment.renderPaymentInput?.()}\n </AutoAutoHeight>\n )}\n </>\n )}\n </form>\n );\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ImportantInformationProps {
|
|
3
|
+
withCheckbox: boolean;
|
|
4
|
+
confirmationError: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<ImportantInformationProps & React.RefAttributes<unknown>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importDefault(require("react"));
|
|
30
|
+
const react_i18next_1 = require("react-i18next");
|
|
31
|
+
const AutoAutoHeight_1 = __importDefault(require("../../../animations/AutoAutoHeight"));
|
|
32
|
+
const Alert_1 = __importStar(require("../../generic/Alert"));
|
|
33
|
+
const Checkbox_1 = __importDefault(require("../../generic/Checkbox/Checkbox"));
|
|
34
|
+
const Headline_1 = __importDefault(require("../../generic/Headline"));
|
|
35
|
+
const Icon_1 = require("../../generic/Icon/Icon");
|
|
36
|
+
const Text_1 = __importStar(require("../../generic/Text"));
|
|
37
|
+
const Translation_1 = require("../../../translations/Translation");
|
|
38
|
+
const Color_1 = require("../../../util/Color");
|
|
39
|
+
exports.default = react_1.default.forwardRef(function StepConfirmationImportantInformation({ confirmationError, withCheckbox }, ref) {
|
|
40
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
41
|
+
return (react_1.default.createElement("div", { className: "u-marg-bottom step-confirmation-important-information" },
|
|
42
|
+
react_1.default.createElement("div", { className: "u-marg-bottom step-confirmation-important-information-headline" },
|
|
43
|
+
react_1.default.createElement(Headline_1.default, { bold: true }, t(Translation_1.Translation.Step.Confirmation.ImportantInformation))),
|
|
44
|
+
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, color: Color_1.Color.Graphite, bold: true, className: "u-marg-bottom step-confirmation-important-information-notes" }, t(Translation_1.Translation.Step.Confirmation.ImportantInformationNotes)),
|
|
45
|
+
withCheckbox && (react_1.default.createElement("div", { className: "step-confirmation-important-information-checkbox" },
|
|
46
|
+
react_1.default.createElement(Checkbox_1.default, { ref: ref, label: react_1.default.createElement("div", null,
|
|
47
|
+
t(Translation_1.Translation.Step.Confirmation.ImportantInformationIHaveUnderstood),
|
|
48
|
+
" ") }))),
|
|
49
|
+
react_1.default.createElement(AutoAutoHeight_1.default, { open: confirmationError },
|
|
50
|
+
react_1.default.createElement("div", { className: "u-flex u-marg-top" },
|
|
51
|
+
react_1.default.createElement(Alert_1.default, { type: Alert_1.AlertType.Danger, icon: Icon_1.IconType.Error },
|
|
52
|
+
react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small }, t(Translation_1.Translation.Step.Confirmation.ImportantInformationError)))))));
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=StepConfirmationImportantInformation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepConfirmationImportantInformation.js","sourceRoot":"/","sources":["src/components/steps/confirmation/StepConfirmationImportantInformation.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iDAA+C;AAE/C,iFAAyD;AAC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;AACN,CAAC,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport AutoAutoHeight from '@/animations/AutoAutoHeight';\nimport Alert, { AlertType } from '@/components/generic/Alert';\nimport Checkbox from '@/components/generic/Checkbox/Checkbox';\nimport Headline from '@/components/generic/Headline';\nimport { IconType } from '@/components/generic/Icon/Icon';\nimport Text, { TextType } from '@/components/generic/Text';\nimport { Translation } from '@/translations/Translation';\nimport { Color } from '@/util/Color';\n\ninterface ImportantInformationProps {\n withCheckbox: boolean;\n confirmationError: boolean;\n}\n\nexport default React.forwardRef(function StepConfirmationImportantInformation({ confirmationError, withCheckbox }: ImportantInformationProps, ref: any) {\n const { t } = useTranslation();\n\n return (\n <div className=\"u-marg-bottom step-confirmation-important-information\">\n <div className=\"u-marg-bottom step-confirmation-important-information-headline\">\n <Headline bold>{t(Translation.Step.Confirmation.ImportantInformation)}</Headline>\n </div>\n <Text type={TextType.Small} color={Color.Graphite} bold className=\"u-marg-bottom step-confirmation-important-information-notes\">\n {t(Translation.Step.Confirmation.ImportantInformationNotes)}\n </Text>\n {withCheckbox && (\n <div className=\"step-confirmation-important-information-checkbox\">\n <Checkbox ref={ref} label={<div>{t(Translation.Step.Confirmation.ImportantInformationIHaveUnderstood)} </div>} />\n </div>\n )}\n\n <AutoAutoHeight open={confirmationError}>\n <div className=\"u-flex u-marg-top\">\n <Alert type={AlertType.Danger} icon={IconType.Error}>\n <Text type={TextType.Small}>{t(Translation.Step.Confirmation.ImportantInformationError)}</Text>\n </Alert>\n </div>\n </AutoAutoHeight>\n </div>\n );\n});\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importDefault(require("react"));
|
|
30
|
+
const react_i18next_1 = require("react-i18next");
|
|
31
|
+
const Text_1 = __importStar(require("../../../generic/Text"));
|
|
32
|
+
const contexts_1 = require("../../../../contexts");
|
|
33
|
+
const Currency_1 = __importDefault(require("../../../../hooks/Currency"));
|
|
34
|
+
const Translation_1 = require("../../../../translations/Translation");
|
|
35
|
+
const Color_1 = require("../../../../util/Color");
|
|
36
|
+
const TextAlignment_1 = require("../../../../util/TextAlignment");
|
|
37
|
+
const TrueRewardsLabel_module_scss_1 = __importDefault(require("./TrueRewardsLabel.module.scss"));
|
|
38
|
+
const TrueRewardsLabel = () => {
|
|
39
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
40
|
+
const { getTotalPayNow } = (0, contexts_1.useBasket)();
|
|
41
|
+
const totalPayNow = getTotalPayNow();
|
|
42
|
+
const { symbol, prettyValue } = (0, Currency_1.default)({
|
|
43
|
+
children: totalPayNow,
|
|
44
|
+
});
|
|
45
|
+
return (react_1.default.createElement("div", { className: "u-flex u-flex-justify-between w-100 u-flex-align-center" },
|
|
46
|
+
react_1.default.createElement("div", { className: TrueRewardsLabel_module_scss_1.default.root },
|
|
47
|
+
react_1.default.createElement(Text_1.default, { align: TextAlignment_1.TextAlign.Left, type: Text_1.TextType.Small, color: Color_1.Color.Navy }, t(Translation_1.Translation.Step.Confirmation.GiftCard))),
|
|
48
|
+
react_1.default.createElement(Text_1.default, { bold: true, className: "u-flex", color: Color_1.Color.Navy, type: Text_1.TextType.Small },
|
|
49
|
+
symbol,
|
|
50
|
+
prettyValue)));
|
|
51
|
+
};
|
|
52
|
+
exports.default = TrueRewardsLabel;
|
|
53
|
+
//# sourceMappingURL=TrueRewardsLabel.js.map
|
package/dist/src/components/steps/confirmation/TrueRewardsPaymentOption/TrueRewardsLabel.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueRewardsLabel.js","sourceRoot":"/","sources":["src/components/steps/confirmation/TrueRewardsPaymentOption/TrueRewardsLabel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iDAA+C;AAE/C,kEAA2D;AAC3D,yCAAuC;AACvC,gEAA2C;AAC3C,4DAAyD;AACzD,wCAAqC;AACrC,wDAAiD;AAEjD,kGAAoD;AAEpD,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC1B,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAC/B,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,oBAAS,GAAE,CAAC;IACvC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAW,EAAC;QACxC,QAAQ,EAAE,WAAW;KACxB,CAAC,CAAC;IAEH,OAAO,CACH,uCAAK,SAAS,EAAC,yDAAyD;QACpE,uCAAK,SAAS,EAAE,sCAAM,CAAC,IAAI;YACvB,8BAAC,cAAI,IAAC,KAAK,EAAE,yBAAS,CAAC,IAAI,EAAE,IAAI,EAAE,eAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,aAAK,CAAC,IAAI,IAC/D,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CACvC,CACL;QACN,8BAAC,cAAI,IAAC,IAAI,QAAC,SAAS,EAAC,QAAQ,EAAC,KAAK,EAAE,aAAK,CAAC,IAAI,EAAE,IAAI,EAAE,eAAQ,CAAC,KAAK;YAChE,MAAM;YACN,WAAW,CACT,CACL,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC","sourcesContent":["import React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport Text, { TextType } from '@/components/generic/Text';\nimport { useBasket } from '@/contexts';\nimport useCurrency from '@/hooks/Currency';\nimport { Translation } from '@/translations/Translation';\nimport { Color } from '@/util/Color';\nimport { TextAlign } from '@/util/TextAlignment';\n\nimport styles from './TrueRewardsLabel.module.scss';\n\nconst TrueRewardsLabel = () => {\n const { t } = useTranslation();\n const { getTotalPayNow } = useBasket();\n const totalPayNow = getTotalPayNow();\n const { symbol, prettyValue } = useCurrency({\n children: totalPayNow,\n });\n\n return (\n <div className=\"u-flex u-flex-justify-between w-100 u-flex-align-center\">\n <div className={styles.root}>\n <Text align={TextAlign.Left} type={TextType.Small} color={Color.Navy}>\n {t(Translation.Step.Confirmation.GiftCard)}\n </Text>\n </div>\n <Text bold className=\"u-flex\" color={Color.Navy} type={TextType.Small}>\n {symbol}\n {prettyValue}\n </Text>\n </div>\n );\n};\n\nexport default TrueRewardsLabel;\n"]}
|