@licklist/design 0.44.551-dev.7 → 0.44.551

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.
Files changed (126) hide show
  1. package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
  2. package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
  3. package/dist/date-time-button/DateContent.d.ts +2 -2
  4. package/dist/date-time-button/DateContent.d.ts.map +1 -1
  5. package/dist/date-time-button/DateContent.js +1 -1
  6. package/dist/date-time-button/DateTimeButton.d.ts +6 -10
  7. package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
  8. package/dist/date-time-button/DateTimeButton.js +1 -1
  9. package/dist/events/event-venue-map/components/MapPoint/MapPoint.d.ts +1 -1
  10. package/dist/events/event-venue-map/components/MapPoint/MapPoint.d.ts.map +1 -1
  11. package/dist/iframe/event/event-booking-products/EventBookingProducts.d.ts +2 -4
  12. package/dist/iframe/event/event-booking-products/EventBookingProducts.d.ts.map +1 -1
  13. package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts +2 -4
  14. package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts.map +1 -1
  15. package/dist/iframe/event/event-order-summary/EventOrderSummary.d.ts +1 -1
  16. package/dist/iframe/event/event-order-summary/EventOrderSummary.d.ts.map +1 -1
  17. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
  18. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
  19. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts +3 -4
  20. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts.map +1 -1
  21. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.js +1 -1
  22. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +4 -3
  23. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
  24. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts +2 -4
  25. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
  26. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
  27. package/dist/iframe/order-process/components/CalendarStepsForm/components/Category.d.ts +1 -1
  28. package/dist/iframe/order-process/components/CalendarStepsForm/components/Category.d.ts.map +1 -1
  29. package/dist/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.d.ts +1 -1
  30. package/dist/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.d.ts.map +1 -1
  31. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts +1 -1
  32. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
  33. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +1 -1
  34. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  35. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts +2 -2
  36. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts.map +1 -1
  37. package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
  38. package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
  39. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts +2 -2
  40. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
  41. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +1 -1
  42. package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.d.ts +2 -2
  43. package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.d.ts.map +1 -1
  44. package/dist/index.js +1 -1
  45. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  46. package/dist/report/index.d.ts +0 -3
  47. package/dist/report/index.d.ts.map +1 -1
  48. package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.d.ts +1 -4
  49. package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.d.ts.map +1 -1
  50. package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.js +1 -1
  51. package/dist/styles/date-time-button/DateTimeButton.scss +4 -0
  52. package/dist/styles/iframe-order-process/IframeOrderProcess.scss +4 -6
  53. package/dist/styles/iframe-page/PageBody.scss +3 -3
  54. package/dist/styles/report/_index.scss +1 -3
  55. package/dist/styles/sales/BookingResults.scss +1 -1
  56. package/dist/styles/sales/ManualBooking.scss +4 -1
  57. package/dist/types/iframe.d.ts +50 -2
  58. package/dist/types/iframe.d.ts.map +1 -1
  59. package/package.json +3 -3
  60. package/src/calendar/components/CalendarDates/CalendarDates.tsx +4 -3
  61. package/src/date-time-button/DateContent.tsx +9 -27
  62. package/src/date-time-button/DateTimeButton.stories.tsx +14 -13
  63. package/src/date-time-button/DateTimeButton.tsx +26 -35
  64. package/src/events/event-venue-map/components/MapPoint/MapPoint.tsx +1 -1
  65. package/src/iframe/event/event-booking-products/EventBookingProducts.tsx +3 -4
  66. package/src/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.tsx +4 -8
  67. package/src/iframe/event/event-order-summary/EventOrderSummary.tsx +2 -0
  68. package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +31 -46
  69. package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +19 -12
  70. package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +66 -48
  71. package/src/iframe/order-process/components/BookingSummary/types/index.ts +4 -3
  72. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -11
  73. package/src/iframe/order-process/components/CalendarStepsForm/components/Category.tsx +1 -1
  74. package/src/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.tsx +1 -4
  75. package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +1 -4
  76. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +1 -4
  77. package/src/iframe/order-process/components/utils/useCategoryVerification.ts +2 -3
  78. package/src/iframe/payment/payment-page/PaymentPage.tsx +6 -5
  79. package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +26 -13
  80. package/src/iframe/payment/payment-status-page/component/PaymentStatusBody.tsx +2 -2
  81. package/src/product-set/control/DateAndRecurrenceInput.tsx +1 -2
  82. package/src/report/index.ts +0 -3
  83. package/src/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.tsx +5 -19
  84. package/src/styles/date-time-button/DateTimeButton.scss +4 -0
  85. package/src/styles/iframe-order-process/IframeOrderProcess.scss +4 -6
  86. package/src/styles/iframe-page/PageBody.scss +3 -3
  87. package/src/styles/report/_index.scss +1 -3
  88. package/src/styles/sales/BookingResults.scss +1 -1
  89. package/src/styles/sales/ManualBooking.scss +4 -1
  90. package/src/types/iframe.ts +58 -2
  91. package/dist/assets/dashboard/info.svg +0 -8
  92. package/dist/assets/dashboard/info.svg.js +0 -1
  93. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts +0 -10
  94. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +0 -1
  95. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +0 -1
  96. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/index.d.ts +0 -2
  97. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/index.d.ts.map +0 -1
  98. package/dist/report/DataFieldsSelector/DataFieldsSelector.d.ts +0 -13
  99. package/dist/report/DataFieldsSelector/DataFieldsSelector.d.ts.map +0 -1
  100. package/dist/report/DataFieldsSelector/DataFieldsSelector.js +0 -1
  101. package/dist/report/DataFieldsSelector/index.d.ts +0 -2
  102. package/dist/report/DataFieldsSelector/index.d.ts.map +0 -1
  103. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts +0 -22
  104. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +0 -1
  105. package/dist/report/ReportRunnerModal/ReportRunnerModal.js +0 -1
  106. package/dist/report/ReportRunnerModal/index.d.ts +0 -2
  107. package/dist/report/ReportRunnerModal/index.d.ts.map +0 -1
  108. package/dist/report/ReportTypeSelect/ReportTypeSelect.d.ts +0 -3
  109. package/dist/report/ReportTypeSelect/ReportTypeSelect.d.ts.map +0 -1
  110. package/dist/report/ReportTypeSelect/ReportTypeSelect.js +0 -1
  111. package/dist/report/ReportTypeSelect/index.d.ts +0 -2
  112. package/dist/report/ReportTypeSelect/index.d.ts.map +0 -1
  113. package/dist/styles/report/ReportEditorModal.scss +0 -98
  114. package/dist/styles/report/ReportRunnerModal.scss +0 -95
  115. package/src/assets/dashboard/info.svg +0 -8
  116. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +0 -43
  117. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/index.ts +0 -1
  118. package/src/report/DataFieldsSelector/DataFieldsSelector.tsx +0 -112
  119. package/src/report/DataFieldsSelector/index.ts +0 -1
  120. package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +0 -187
  121. package/src/report/ReportRunnerModal/index.ts +0 -1
  122. package/src/report/ReportTypeSelect/ReportTypeSelect.tsx +0 -68
  123. package/src/report/ReportTypeSelect/index.ts +0 -1
  124. package/src/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.stories.tsx +0 -48
  125. package/src/styles/report/ReportEditorModal.scss +0 -98
  126. package/src/styles/report/ReportRunnerModal.scss +0 -95
@@ -1,95 +0,0 @@
1
- .report-runner-modal {
2
- .modal-dialog {
3
- @include media-breakpoint-up(sm) {
4
- max-width: 45rem;
5
- }
6
- }
7
-
8
- .modal-content {
9
- max-width: 45rem;
10
- margin: 0 auto;
11
- padding: 1.25rem 1.5rem;
12
-
13
- header {
14
- display: flex;
15
- justify-content: space-between;
16
- align-items: center;
17
- margin-bottom: 1rem;
18
- border-bottom: 2px solid #dcdcdc;
19
-
20
- h5 {
21
- margin-bottom: 0;
22
- font-size: 1.125rem;
23
- font-weight: 500;
24
- }
25
-
26
- button {
27
- padding-top: 0.5rem;
28
- padding-bottom: 0.5rem;
29
- font-size: 0.875rem;
30
- font-weight: 600;
31
- color: #0e8ce2;
32
- }
33
- }
34
-
35
- .data-fields {
36
- display: flex;
37
- flex-wrap: wrap;
38
-
39
- span {
40
- position: relative;
41
- font-size: 0.875rem;
42
- font-weight: 500;
43
-
44
- &:after {
45
- content: "|";
46
- margin: 0 0.25rem;
47
- color: #dcdcdc;
48
- }
49
-
50
- &:last-child:after {
51
- display: none;
52
- }
53
- }
54
- }
55
-
56
- .edit-button {
57
- padding: 0;
58
- font-size: 0.875rem;
59
- font-weight: 600;
60
- color: #0e8ce2;
61
- text-decoration: underline;
62
-
63
- &:focus {
64
- box-shadow: none;
65
- }
66
- }
67
-
68
- input {
69
- border-radius: 0.5rem;
70
- }
71
-
72
- form {
73
- margin-top: 1.25rem;
74
-
75
- .controls {
76
- display: flex;
77
- gap: 2rem;
78
- align-items: flex-start;
79
- flex-wrap: wrap;
80
- }
81
-
82
- .form-group {
83
- flex: 1;
84
- }
85
-
86
- button[type="submit"] {
87
- white-space: nowrap;
88
- }
89
- }
90
-
91
- .loader {
92
- height: 10rem;
93
- }
94
- }
95
- }
@@ -1,8 +0,0 @@
1
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none"
2
- xmlns="http://www.w3.org/2000/svg">
3
- <g id="Info icon">
4
- <circle id="Oval" cx="10" cy="6" r="1.25" fill="#0E8CE2"/>
5
- <rect id="Rectangle" x="9" y="8" width="2" height="7" fill="#0E8CE2"/>
6
- <circle id="Oval_2" cx="10" cy="10" r="9" stroke="#0E8CE2" stroke-width="2"/>
7
- </g>
8
- </svg>
@@ -1,43 +0,0 @@
1
- import React from "react";
2
- import { useTranslation } from "react-i18next";
3
- import { useIntl } from "react-intl";
4
- import * as Config from "@licklist/core/dist/Config";
5
- import { OrderItem } from "@licklist/plugins/dist/types/context/Iframe/orderItems";
6
-
7
- type ProductSummaryProps = {
8
- name?: string;
9
- productQuantityError?: string;
10
- orderProduct: OrderItem;
11
- };
12
-
13
- export const ProductSummary = ({
14
- name,
15
- productQuantityError,
16
- orderProduct,
17
- }: ProductSummaryProps) => {
18
- const { t } = useTranslation("Design");
19
- const { formatNumber } = useIntl();
20
-
21
- const price = formatNumber(
22
- (orderProduct?.deposit || orderProduct?.price || 0) *
23
- orderProduct?.quantity,
24
- { style: "currency", currency: Config.Currency.GBP }
25
- );
26
-
27
- return (
28
- <div className="product">
29
- <p className="m-0 name">{name ?? orderProduct?.name}</p>
30
- <div className="d-flex justify-content-between">
31
- <p className="m-0">
32
- {t("shortQuantity")}:&nbsp;{orderProduct?.quantity}
33
- </p>
34
-
35
- <p className="price">{price}</p>
36
- </div>
37
-
38
- {productQuantityError && (
39
- <p className="iframe-event__message-error">{productQuantityError}</p>
40
- )}
41
- </div>
42
- );
43
- };
@@ -1 +0,0 @@
1
- export * from "./ProductSummary";
@@ -1,112 +0,0 @@
1
- import React, { ChangeEvent } from "react";
2
- import { useId } from "@react-aria/utils";
3
- import { xor } from "lodash";
4
- import { useTranslation } from "react-i18next";
5
- import { Form, Row, Col } from "react-bootstrap";
6
- import { Controller, useFormContext } from "react-hook-form";
7
- import { LoaderIndicator } from "../../static/loader/LoaderIndicator";
8
-
9
- type ReportField = {
10
- id: number;
11
- key: string;
12
- title: string;
13
- };
14
-
15
- interface DataFieldsSelectorType {
16
- reportFields: ReportField[];
17
- isLoading?: boolean;
18
- }
19
-
20
- export const DataFieldsSelector = ({
21
- reportFields,
22
- isLoading,
23
- }: DataFieldsSelectorType) => {
24
- const { t } = useTranslation(["App", "Design"]);
25
- const {
26
- control,
27
- formState: { errors },
28
- } = useFormContext();
29
-
30
- return (
31
- <>
32
- {isLoading && (
33
- <div className="report-fields-loader">
34
- <LoaderIndicator />
35
- </div>
36
- )}
37
-
38
- {!isLoading && (
39
- <>
40
- <Form.Label className="mt-4">{t("dataFields")}</Form.Label>
41
- <Row>
42
- <Controller
43
- name="reportFieldValues"
44
- data-testid="report-field-values-select"
45
- control={control}
46
- rules={{
47
- validate: (value) => {
48
- if (value.length > 0) return true;
49
- return t("dataFieldRequired") as string;
50
- },
51
- }}
52
- render={({ field }) => {
53
- const onChange = (e: ChangeEvent<HTMLInputElement>) => {
54
- // xor adds value if not present, removes if present
55
- field.onChange(xor(field.value, [Number(e.target.value)]));
56
- };
57
-
58
- return (
59
- <>
60
- {reportFields?.map((reportField) => (
61
- <Col key={reportField.id} lg={6}>
62
- <Checkbox
63
- value={reportField.id}
64
- onChange={onChange}
65
- label={reportField.title}
66
- checked={field.value.includes(reportField.id)}
67
- />
68
- </Col>
69
- ))}
70
- </>
71
- );
72
- }}
73
- />
74
- </Row>
75
-
76
- {errors.reportFieldValues?.message && (
77
- <Row>
78
- <Col>
79
- <div className="invalid-feedback field-values-error">
80
- {errors.reportFieldValues?.message}
81
- </div>
82
- </Col>
83
- </Row>
84
- )}
85
- </>
86
- )}
87
- </>
88
- );
89
- };
90
-
91
- type CheckboxProps = {
92
- onChange: (e: ChangeEvent<HTMLInputElement>) => void;
93
- value: number;
94
- label: string;
95
- checked: boolean;
96
- };
97
-
98
- const Checkbox = ({ onChange, value, label, checked }: CheckboxProps) => {
99
- const checkboxId = useId();
100
-
101
- return (
102
- <Form.Group controlId={checkboxId} className="custom-checkbox">
103
- <Form.Check
104
- label={label}
105
- value={value}
106
- onChange={onChange}
107
- checked={checked}
108
- custom
109
- />
110
- </Form.Group>
111
- );
112
- };
@@ -1 +0,0 @@
1
- export * from "./DataFieldsSelector";
@@ -1,187 +0,0 @@
1
- import { Report, ReportType } from "@licklist/core/dist/DataMapper/Report";
2
- import { capitalize } from "lodash";
3
- import React from "react";
4
- import { Button, Form, Modal } from "react-bootstrap";
5
- import { useForm } from "react-hook-form";
6
- import { useTranslation } from "react-i18next";
7
- import { openOnlineViewer } from "@licklist/plugins/dist/utils/report";
8
- import { HttpQuery } from "@licklist/plugins/dist/hooks/Api/useHttpQuery";
9
- import { CachedHttpQueryResponse } from "@licklist/plugins/dist/hooks/Api/useCachedHttpQuery";
10
- import { BlockLoader } from "../../static/loader";
11
-
12
- interface ReportField {
13
- id: number;
14
- key: string;
15
- title: string;
16
- }
17
-
18
- type ReportRunnerModalProps = {
19
- reportId: Report["id"] | null;
20
- show: boolean;
21
- useShowReportFields: (
22
- reportType?: ReportType
23
- ) => CachedHttpQueryResponse<ReportField[], unknown>;
24
- generate?: HttpQuery<Record<string, string>[] | null>;
25
- download?: HttpQuery<Blob | null>;
26
- onHide: () => void;
27
- onEdit: () => void;
28
- reports?: Report[] | null;
29
- };
30
-
31
- type FormValues = {
32
- dateFrom: string;
33
- dateTo: string;
34
- };
35
-
36
- export const ReportRunnerModal = ({
37
- reportId,
38
- show,
39
- onHide,
40
- useShowReportFields,
41
- reports,
42
- generate,
43
- download,
44
- onEdit,
45
- }: ReportRunnerModalProps) => {
46
- const { t } = useTranslation(["App", "Design"]);
47
- const report = reports?.find((report) => report.id === reportId);
48
-
49
- const { data: reportFields = [], isLoading: isLoadingReportFields } =
50
- useShowReportFields(report?.type);
51
-
52
- const {
53
- handleSubmit,
54
- register,
55
- formState: { errors },
56
- reset,
57
- watch,
58
- } = useForm<FormValues>({ mode: "onChange" });
59
- const dateFrom = watch("dateFrom");
60
-
61
- const onDownload = handleSubmit((values) => {
62
- download.execute({ ...values, reportId, type: report?.type });
63
- });
64
-
65
- const onViewOnline = handleSubmit(async (values) => {
66
- const data = await generate.execute({
67
- ...values,
68
- reportId,
69
- });
70
- if (!report || !data || generate.isError) return;
71
-
72
- openOnlineViewer({
73
- type: report.type,
74
- dateFrom: values.dateFrom,
75
- dateTo: values.dateTo,
76
- data,
77
- });
78
- });
79
-
80
- const onClose = () => {
81
- reset();
82
- onHide();
83
- };
84
-
85
- const isLoading =
86
- generate.isLoading || download.isLoading || isLoadingReportFields;
87
-
88
- return (
89
- <Modal
90
- show={show}
91
- onHide={onClose}
92
- className="report-runner-modal"
93
- centered
94
- >
95
- <header>
96
- <h5>{t("generateReport")}</h5>
97
- <Button variant="" data-testid="cancel-button" onClick={onClose}>
98
- {t("cancel")}
99
- </Button>
100
- </header>
101
-
102
- {isLoading && <BlockLoader />}
103
-
104
- {!isLoading && (
105
- <div>
106
- <div className="report-type-label">{capitalize(report?.type)}</div>
107
- <div>{report?.name}</div>
108
- <div className="data-fields">
109
- {report?.reportFieldValues.map((fieldValue) => {
110
- const field = reportFields?.find(
111
- (field) => field.id === fieldValue.reportFieldId
112
- );
113
- if (!field) return null;
114
- return <span key={fieldValue.id}>{field.title}</span>;
115
- })}
116
- </div>
117
-
118
- <Button
119
- className="edit-button"
120
- type="button"
121
- variant=""
122
- data-testid="edit-button"
123
- onClick={onEdit}
124
- >
125
- {t("Design:edit")}
126
- </Button>
127
-
128
- <form noValidate>
129
- <div className="controls">
130
- <Form.Group controlId="from-input">
131
- <Form.Label>{t("Design:from")}</Form.Label>
132
- <Form.Control
133
- type="datetime-local"
134
- data-testid="date-from-input"
135
- isInvalid={!!errors.dateFrom}
136
- {...register("dateFrom", {
137
- required: {
138
- value: true,
139
- message: `${t("Validation:fieldRequired", {
140
- attribute: t("Design:to"),
141
- })}`,
142
- },
143
- })}
144
- />
145
- <Form.Control.Feedback type="invalid">
146
- {errors.dateFrom?.message}
147
- </Form.Control.Feedback>
148
- </Form.Group>
149
-
150
- <Form.Group controlId="to-input">
151
- <Form.Label>{t("Design:to")}</Form.Label>
152
- <Form.Control
153
- type="datetime-local"
154
- data-testid="date-to-input"
155
- isInvalid={!!errors.dateTo}
156
- {...register("dateTo", {
157
- required: `${t("Validation:fieldRequired", {
158
- attribute: t("Design:to"),
159
- })}`,
160
- validate(value) {
161
- if (!dateFrom) return true;
162
- if (value > dateFrom) return true;
163
- return t("toDateAfterFrom") as string;
164
- },
165
- })}
166
- />
167
- <Form.Control.Feedback type="invalid">
168
- {errors.dateTo?.message}
169
- </Form.Control.Feedback>
170
- </Form.Group>
171
- </div>
172
-
173
- <div className="controls">
174
- <Button data-testid="download-button" onClick={onDownload}>
175
- {t("generateDownload")}
176
- </Button>
177
-
178
- <Button data-testid="view-button" onClick={onViewOnline}>
179
- {t("generateView")}
180
- </Button>
181
- </div>
182
- </form>
183
- </div>
184
- )}
185
- </Modal>
186
- );
187
- };
@@ -1 +0,0 @@
1
- export * from "./ReportRunnerModal";
@@ -1,68 +0,0 @@
1
- import { reportTypes } from "@licklist/core/dist/DataMapper/Report";
2
- import { capitalize } from "lodash";
3
- import React from "react";
4
- import { Row, Col, Form, OverlayTrigger, Popover } from "react-bootstrap";
5
- import { useFormContext } from "react-hook-form";
6
- import { useTranslation } from "react-i18next";
7
- import { ReactComponent as InfoIcon } from "../../assets/dashboard/info.svg";
8
-
9
- export const ReportTypeSelect = () => {
10
- const { t } = useTranslation(["App", "Design"]);
11
-
12
- const {
13
- register,
14
- formState: { errors },
15
- setValue,
16
- } = useFormContext();
17
-
18
- return (
19
- <Row>
20
- <Col lg={6} className="mt-4">
21
- <Form.Group controlId="typeSelect">
22
- <Form.Label>{t("reportType")}</Form.Label>
23
-
24
- <Form.Control
25
- as="select"
26
- data-testid="report-type-select"
27
- isInvalid={!!errors.type}
28
- {...register("type", {
29
- required: {
30
- value: true,
31
- message: `${t("Validation:fieldRequired", {
32
- attribute: t("reportType"),
33
- })}`,
34
- },
35
- })}
36
- onChange={(event) => {
37
- register("type").onChange(event);
38
- setValue("reportFieldValues", []);
39
- }}
40
- >
41
- {reportTypes.map((reportType) => (
42
- <option key={reportType} value={reportType}>
43
- {capitalize(reportType)}
44
- </option>
45
- ))}
46
- </Form.Control>
47
-
48
- <Form.Control.Feedback type="invalid">
49
- {errors.type?.message}
50
- </Form.Control.Feedback>
51
-
52
- <OverlayTrigger
53
- trigger="hover"
54
- overlay={
55
- <Popover id="report-type-popover">
56
- <Popover.Content className="reports-popover">
57
- {t("reportTypeSelectInfo")}
58
- </Popover.Content>
59
- </Popover>
60
- }
61
- >
62
- <InfoIcon className="info-icon" />
63
- </OverlayTrigger>
64
- </Form.Group>
65
- </Col>
66
- </Row>
67
- );
68
- };
@@ -1 +0,0 @@
1
- export * from "./ReportTypeSelect";
@@ -1,48 +0,0 @@
1
- import React, { useRef, useState } from "react";
2
- import { Meta, Story } from "@storybook/react";
3
- import { NumberInputHorizontal } from "./NumberInputHorizontal";
4
-
5
- export default {
6
- title: "Manual Booking/NumberInputHorizontal",
7
- } as Meta;
8
-
9
- export const Default: Story<any> = (args) => {
10
- const ref = useRef(null);
11
- const [value, setValue] = useState(0);
12
- const [isDisabled, setDisabled] = useState(true);
13
-
14
- const onPriceClick = (e) => {
15
- if (!isDisabled) {
16
- return;
17
- }
18
- console.log("click");
19
- setDisabled(false);
20
- };
21
-
22
- return (
23
- <div
24
- role="button"
25
- tabIndex={0}
26
- onClick={onPriceClick}
27
- onKeyDown={onPriceClick}
28
- style={{ height: "250px", width: "370px" }}
29
- >
30
- <NumberInputHorizontal
31
- ref={ref}
32
- hasCurrency
33
- onSelect={onPriceClick}
34
- onChange={(val) => {
35
- setValue(val);
36
- }}
37
- onMinusClick={() => {
38
- setValue(value - 1 || 0);
39
- }}
40
- onPlusClick={() => {
41
- setValue((value ?? 0) + 1);
42
- }}
43
- value={value}
44
- disabled={isDisabled}
45
- />
46
- </div>
47
- );
48
- };
@@ -1,98 +0,0 @@
1
- .report-builder {
2
- .modal-dialog {
3
- @include media-breakpoint-up(sm) {
4
- max-width: 45rem;
5
- }
6
- }
7
-
8
- .modal-content {
9
- max-width: 45rem;
10
- margin: 0 auto;
11
- padding: 1.25rem 1.5rem;
12
-
13
- header {
14
- display: flex;
15
- justify-content: space-between;
16
- align-items: center;
17
- margin-bottom: 1rem;
18
- border-bottom: 2px solid #dcdcdc;
19
-
20
- h5 {
21
- margin-bottom: 0;
22
- font-size: 1.125rem;
23
- font-weight: 500;
24
- }
25
-
26
- button {
27
- padding-top: 0.5rem;
28
- padding-bottom: 0.5rem;
29
- font-size: 0.875rem;
30
- font-weight: 600;
31
- color: #0e8ce2;
32
- }
33
- }
34
-
35
- .data-fields {
36
- display: flex;
37
- flex-wrap: wrap;
38
-
39
- span {
40
- position: relative;
41
- font-size: 0.875rem;
42
- font-weight: 500;
43
-
44
- &:after {
45
- content: "|";
46
- margin: 0 0.25rem;
47
- color: #dcdcdc;
48
- }
49
-
50
- &:last-child:after {
51
- display: none;
52
- }
53
- }
54
- }
55
-
56
- .edit-button {
57
- padding: 0;
58
- font-size: 0.875rem;
59
- font-weight: 600;
60
- color: #0e8ce2;
61
- text-decoration: underline;
62
-
63
- &:focus {
64
- box-shadow: none;
65
- }
66
- }
67
-
68
- input {
69
- border-radius: 0.5rem;
70
- }
71
-
72
- form {
73
- margin-top: 1.25rem;
74
-
75
- .controls {
76
- display: flex;
77
- gap: 2rem;
78
- align-items: flex-start;
79
- flex-wrap: wrap;
80
- }
81
-
82
- .form-group {
83
- flex: 1;
84
- }
85
-
86
- button[type="submit"] {
87
- white-space: nowrap;
88
- }
89
- }
90
-
91
- .loader {
92
- height: 10rem;
93
- }
94
- }
95
- button[type="submit"] {
96
- margin-top: 1.5rem;
97
- }
98
- }