@licklist/design 0.71.20 → 0.71.22
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/iframe/activity-card/ActivityCard.d.ts +1 -2
- package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
- package/dist/iframe/activity-card/ActivityCard.js +1 -7
- package/dist/index.js +1 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +48 -2
- package/dist/product-set/form/SelectCategoryModal.d.ts +12 -0
- package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
- package/dist/product-set/form/SelectCategoryModal.js +1 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts +1 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +1 -1
- package/dist/sales/modals/refund-modal/RefundModal.d.ts +6 -2
- package/dist/sales/modals/refund-modal/RefundModal.d.ts.map +1 -1
- package/dist/sales/modals/refund-modal/RefundModal.js +8 -4
- package/dist/sales/modals/refund-modal/index.d.ts +2 -2
- package/dist/sales/modals/refund-modal/index.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts +2 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +10 -4
- package/dist/styles/date-time-button/DateTimeButton.scss +1 -1
- package/dist/styles/product-set/ProductSetForm.scss +25 -2
- package/package.json +2 -2
- package/src/iframe/activity-card/ActivityCard.stories.tsx +0 -2
- package/src/iframe/activity-card/ActivityCard.tsx +0 -4
- package/src/product-set/form/ProductCategoriesControl.tsx +37 -1
- package/src/product-set/form/SelectCategoryModal.tsx +2 -2
- package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +1 -1
- package/src/sales/modals/refund-modal/RefundModal.tsx +15 -6
- package/src/sales/modals/refund-modal/index.ts +7 -2
- package/src/sortable-tree/SortableTreeItem.tsx +12 -1
- package/src/styles/date-time-button/DateTimeButton.scss +1 -1
- package/src/styles/product-set/ProductSetForm.scss +25 -2
- package/yarn.lock +219 -219
|
@@ -6,7 +6,6 @@ export declare const LAYOUT_GRID = "grid";
|
|
|
6
6
|
export declare const LAYOUT_LIST = "list";
|
|
7
7
|
export type ActivityCardProps = {
|
|
8
8
|
title: ReactNode;
|
|
9
|
-
duration: ReactNode;
|
|
10
9
|
price: ReactNode;
|
|
11
10
|
description?: ReactNode;
|
|
12
11
|
onSelect: () => void;
|
|
@@ -17,5 +16,5 @@ export type ActivityCardProps = {
|
|
|
17
16
|
resources?: ZoneResourcesAvailability;
|
|
18
17
|
availabilityFormat?: AvailabilityFormat | null;
|
|
19
18
|
};
|
|
20
|
-
export declare const ActivityCard: ({ title,
|
|
19
|
+
export declare const ActivityCard: ({ title, price, description, availableTimes, image, onSelect, isSelected, layout, availabilityFormat, resources, }: ActivityCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
20
|
//# sourceMappingURL=ActivityCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityCard.d.ts","sourceRoot":"","sources":["../../../src/iframe/activity-card/ActivityCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAA;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,0EAA0E,CAAA;AACpH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAA;AAG9F,eAAO,MAAM,WAAW,SAAS,CAAA;AACjC,eAAO,MAAM,WAAW,SAAS,CAAA;AAEjC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,SAAS,CAAA;IAChB,
|
|
1
|
+
{"version":3,"file":"ActivityCard.d.ts","sourceRoot":"","sources":["../../../src/iframe/activity-card/ActivityCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAA;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,0EAA0E,CAAA;AACpH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAA;AAG9F,eAAO,MAAM,WAAW,SAAS,CAAA;AACjC,eAAO,MAAM,WAAW,SAAS,CAAA;AAEjC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,WAAW,GAAG,OAAO,WAAW,CAAA;IAChD,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,yBAAyB,CAAA;IACrC,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAA;CAC/C,CAAA;AAED,eAAO,MAAM,YAAY,uHAWtB,iBAAiB,4CA2DnB,CAAA"}
|
|
@@ -5,7 +5,7 @@ import { AvailabilityIndicator } from '../../availability-indicator/Availability
|
|
|
5
5
|
var LAYOUT_GRID = 'grid';
|
|
6
6
|
var LAYOUT_LIST = 'list';
|
|
7
7
|
var ActivityCard = function(param) {
|
|
8
|
-
var title = param.title,
|
|
8
|
+
var title = param.title, price = param.price, description = param.description, availableTimes = param.availableTimes, image = param.image, onSelect = param.onSelect, isSelected = param.isSelected, _param_layout = param.layout, layout = _param_layout === void 0 ? LAYOUT_GRID : _param_layout, availabilityFormat = param.availabilityFormat, resources = param.resources;
|
|
9
9
|
if (layout === LAYOUT_GRID) {
|
|
10
10
|
return /*#__PURE__*/ jsxs("button", {
|
|
11
11
|
type: "button",
|
|
@@ -24,9 +24,6 @@ var ActivityCard = function(param) {
|
|
|
24
24
|
className: "activity-card-title",
|
|
25
25
|
children: title
|
|
26
26
|
}),
|
|
27
|
-
duration && /*#__PURE__*/ jsx("div", {
|
|
28
|
-
children: duration
|
|
29
|
-
}),
|
|
30
27
|
price && /*#__PURE__*/ jsx("div", {
|
|
31
28
|
children: price
|
|
32
29
|
}),
|
|
@@ -64,9 +61,6 @@ var ActivityCard = function(param) {
|
|
|
64
61
|
availableTimes && /*#__PURE__*/ jsx("div", {
|
|
65
62
|
children: availableTimes
|
|
66
63
|
}),
|
|
67
|
-
duration && /*#__PURE__*/ jsx("div", {
|
|
68
|
-
children: duration
|
|
69
|
-
}),
|
|
70
64
|
price && /*#__PURE__*/ jsx("div", {
|
|
71
65
|
children: price
|
|
72
66
|
}),
|
package/dist/index.js
CHANGED
|
@@ -130,7 +130,7 @@ export { ManualBookingSummary } from './sales/manual-booking/summary/ManualBooki
|
|
|
130
130
|
export { SearchUser } from './sales/manual-booking/search-user/SearchUser.js';
|
|
131
131
|
export { SelectDateTypeControl } from './sales/manual-booking/select-date-type-control/SelectDateTypeControl.js';
|
|
132
132
|
export { SelectMenu } from './sales/manual-booking/select-menu/SelectMenu.js';
|
|
133
|
-
export { RefundModal } from './sales/modals/refund-modal/RefundModal.js';
|
|
133
|
+
export { FULL_REFUND_TYPE, NET_REFUND_TYPE, PARTIAL_REFUND_TYPE, RefundModal } from './sales/modals/refund-modal/RefundModal.js';
|
|
134
134
|
export { PaymentModal } from './sales/modals/payment-modal/PaymentModal.js';
|
|
135
135
|
export { SalePaymentForm } from './sales/payment-form/SalePaymentForm.js';
|
|
136
136
|
export { RyftPayment } from './sales/payment-form/components/RyftPayment/RyftPayment.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductCategoriesControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductCategoriesControl.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductCategoriesControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductCategoriesControl.tsx"],"names":[],"mappings":"AAaA,OAAO,EAKL,YAAY,EACb,MAAM,kEAAkE,CAAA;AAQzE,OAAO,EAAwB,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAoCtE,UAAU,6BAA8B,SAAQ,aAAa;IAC3D,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AA2BD,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,EACT,SAAS,EACT,WAAW,EACX,qBAAqB,EACrB,oBAAoB,GACrB,EAAE,6BAA6B,2CA4T/B;AAED,eAAO,MAAM,cAAc,iBACX,YAAY,SACnB,MAAM,KACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAczC,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsxs, Fragment
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useContext, useState, useEffect } from 'react';
|
|
3
3
|
import HookFormService from '@licklist/plugins/dist/services/Form/HookFormService';
|
|
4
4
|
import { uniqueId } from 'lodash';
|
|
5
5
|
import { Badge } from 'react-bootstrap';
|
|
6
6
|
import { useFormContext, useFieldArray, useWatch, Controller } from 'react-hook-form';
|
|
7
|
+
import { FaTicketAlt, FaCalendar, FaBars, FaBowlingBall } from 'react-icons/fa';
|
|
7
8
|
import { useTranslation } from 'react-i18next';
|
|
8
9
|
import { useSensor, MouseSensor } from '@dnd-kit/core';
|
|
9
10
|
import { CATEGORY_TYPE_GAME, CATEGORY_TYPE_FIXED_DURATION, QUANTITY_TYPE_STANDARD, CATEGORY_TYPE_TICKETS } from '@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper';
|
|
@@ -13,7 +14,7 @@ import { ProductSetModalClasses } from '../../sortable-tree/SortableTreeItem.js'
|
|
|
13
14
|
import { CreateProductSetItem } from '../item/CreateProductSetItem.js';
|
|
14
15
|
import { ProductCategoryControl } from '../product-category/ProductCategoryControl.js';
|
|
15
16
|
import { ProductsControl } from './ProductsControl.js';
|
|
16
|
-
import { SelectCategoryModal } from './SelectCategoryModal.js';
|
|
17
|
+
import { CATEGORY_TYPES_NAMES, SelectCategoryModal } from './SelectCategoryModal.js';
|
|
17
18
|
import { ProductSetLoadingContext } from './context.js';
|
|
18
19
|
import { VenueMapSetModal } from './VenueMapSetModal.js';
|
|
19
20
|
import { sortArrayByIndex, moveArrayElements } from '../utils/index.js';
|
|
@@ -117,6 +118,40 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
117
118
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
118
119
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
119
120
|
}
|
|
121
|
+
var _obj;
|
|
122
|
+
// @TODO not for first release
|
|
123
|
+
// import Popover from "./ProductSetFormPopover";
|
|
124
|
+
var CATEGORIES_TYPE = (_obj = {}, _define_property(_obj, CATEGORY_TYPES_NAMES.tickets, {
|
|
125
|
+
label: 'tickets',
|
|
126
|
+
icon: /*#__PURE__*/ jsx(FaTicketAlt, {
|
|
127
|
+
color: "#0e8ce2",
|
|
128
|
+
size: 10
|
|
129
|
+
})
|
|
130
|
+
}), _define_property(_obj, CATEGORY_TYPES_NAMES.bookings, {
|
|
131
|
+
label: 'bookings',
|
|
132
|
+
icon: /*#__PURE__*/ jsx(FaCalendar, {
|
|
133
|
+
color: "#0e8ce2",
|
|
134
|
+
size: 10
|
|
135
|
+
})
|
|
136
|
+
}), _define_property(_obj, CATEGORY_TYPES_NAMES.menuItems, {
|
|
137
|
+
label: 'menuItems',
|
|
138
|
+
icon: /*#__PURE__*/ jsx(FaBars, {
|
|
139
|
+
color: "#0e8ce2",
|
|
140
|
+
size: 10
|
|
141
|
+
})
|
|
142
|
+
}), _define_property(_obj, CATEGORY_TYPES_NAMES.game, {
|
|
143
|
+
label: 'game',
|
|
144
|
+
icon: /*#__PURE__*/ jsx(FaBowlingBall, {
|
|
145
|
+
color: "#0e8ce2",
|
|
146
|
+
size: 10
|
|
147
|
+
})
|
|
148
|
+
}), _define_property(_obj, CATEGORY_TYPES_NAMES.fixedDuration, {
|
|
149
|
+
label: 'fixedDuration',
|
|
150
|
+
icon: /*#__PURE__*/ jsx(FaCalendar, {
|
|
151
|
+
color: "#0e8ce2",
|
|
152
|
+
size: 10
|
|
153
|
+
})
|
|
154
|
+
}), _obj);
|
|
120
155
|
var getCategoryDefaultValue = function(categoryType, sort) {
|
|
121
156
|
return {
|
|
122
157
|
id: null,
|
|
@@ -251,6 +286,7 @@ function ProductCategoriesControl(param) {
|
|
|
251
286
|
var onSetIsExpanded = function() {
|
|
252
287
|
setIsExpanded(productCategoryId);
|
|
253
288
|
};
|
|
289
|
+
var categoryType = CATEGORIES_TYPE[productCategory.type];
|
|
254
290
|
return /*#__PURE__*/ jsx(Controller, {
|
|
255
291
|
name: "".concat(productCategoriesFieldName, ".").concat(index, ".name"),
|
|
256
292
|
control: control,
|
|
@@ -300,6 +336,16 @@ function ProductCategoriesControl(param) {
|
|
|
300
336
|
secondaryBadge: getBadgeConfig(productCategory.type, t(productCategory.type)),
|
|
301
337
|
modalClass: ProductSetModalClasses.category,
|
|
302
338
|
isNewAdded: showCategoryModal,
|
|
339
|
+
itemButton: /*#__PURE__*/ jsxs("div", {
|
|
340
|
+
className: "btn-outline-primary item-icon sm border border-primary rounded-sm",
|
|
341
|
+
children: [
|
|
342
|
+
categoryType.icon,
|
|
343
|
+
/*#__PURE__*/ jsx("span", {
|
|
344
|
+
className: "ml-2",
|
|
345
|
+
children: t(categoryType.label)
|
|
346
|
+
})
|
|
347
|
+
]
|
|
348
|
+
}),
|
|
303
349
|
body: /*#__PURE__*/ jsx(ProductCategoryControl, {
|
|
304
350
|
isLoading: isLoading,
|
|
305
351
|
onCategoryNameChange: onChange,
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
1
2
|
import { CategoryType } from '@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper';
|
|
3
|
+
export declare const CATEGORY_TYPES_NAMES: {
|
|
4
|
+
readonly menuItems: "menuItems";
|
|
5
|
+
readonly tickets: "tickets";
|
|
6
|
+
readonly bookings: "bookings";
|
|
7
|
+
readonly game: "game";
|
|
8
|
+
readonly fixedDuration: "fixedDuration";
|
|
9
|
+
};
|
|
10
|
+
export type CategoryConfig = {
|
|
11
|
+
label: string;
|
|
12
|
+
icon: ReactElement;
|
|
13
|
+
};
|
|
2
14
|
export interface SelectCategoryModalProps {
|
|
3
15
|
isVisible: boolean;
|
|
4
16
|
onHide: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectCategoryModal.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/SelectCategoryModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectCategoryModal.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/SelectCategoryModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAwB,MAAM,OAAO,CAAA;AAG1D,OAAO,EAML,YAAY,EACb,MAAM,kEAAkE,CAAA;AAgBzE,eAAO,MAAM,oBAAoB;;;;;;CAMvB,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,CAAA;AA4BlE,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAA;CACnD;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,MAAM,EACN,gBAAgB,GACjB,EAAE,wBAAwB,2CAyH1B"}
|
|
@@ -17,6 +17,6 @@ export type ReportRunnerModalProps = {
|
|
|
17
17
|
reports?: Report[] | null;
|
|
18
18
|
providerId?: number;
|
|
19
19
|
};
|
|
20
|
-
export declare const ReportRunnerModal: ({ reportId, show, onHide, useShowReportFields, reports, generate, download, onEdit, providerId }: ReportRunnerModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const ReportRunnerModal: ({ reportId, show, onHide, useShowReportFields, reports, generate, download, onEdit, providerId, }: ReportRunnerModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export {};
|
|
22
22
|
//# sourceMappingURL=ReportRunnerModal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportRunnerModal.d.ts","sourceRoot":"","sources":["../../../src/report/ReportRunnerModal/ReportRunnerModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,MAAM,EAEN,UAAU,EACX,MAAM,uCAAuC,CAAA;AAM9C,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAA;AAG7F,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC7B,IAAI,EAAE,OAAO,CAAA;IACb,mBAAmB,EAAE,CACnB,UAAU,CAAC,EAAE,UAAU,KACpB,uBAAuB,CAAC,WAAW,EAAE,EAAE,OAAO,CAAC,CAAA;IACpD,QAAQ,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;IACrD,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;IACjC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AASD,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ReportRunnerModal.d.ts","sourceRoot":"","sources":["../../../src/report/ReportRunnerModal/ReportRunnerModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,MAAM,EAEN,UAAU,EACX,MAAM,uCAAuC,CAAA;AAM9C,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAA;AAG7F,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC7B,IAAI,EAAE,OAAO,CAAA;IACb,mBAAmB,EAAE,CACnB,UAAU,CAAC,EAAE,UAAU,KACpB,uBAAuB,CAAC,WAAW,EAAE,EAAE,OAAO,CAAC,CAAA;IACpD,QAAQ,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;IACrD,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;IACjC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AASD,eAAO,MAAM,iBAAiB,sGAU3B,sBAAsB,4CA8KxB,CAAA"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { OrderPaymentType } from '@licklist/core/dist/DataMapper/Order/OrderPaymentDataMapper';
|
|
2
|
+
export declare const FULL_REFUND_TYPE = "fullRefund";
|
|
3
|
+
export declare const PARTIAL_REFUND_TYPE = "partialRefund";
|
|
4
|
+
export declare const NET_REFUND_TYPE = "netRefund";
|
|
5
|
+
export type RefundType = typeof FULL_REFUND_TYPE | typeof PARTIAL_REFUND_TYPE | typeof NET_REFUND_TYPE;
|
|
2
6
|
export interface RefundModalProps {
|
|
3
7
|
isVisible: boolean;
|
|
4
|
-
|
|
8
|
+
refundType?: RefundType;
|
|
5
9
|
onHide: () => void;
|
|
6
10
|
onSubmit: (amount?: number) => void;
|
|
7
11
|
isLoading?: boolean;
|
|
@@ -9,5 +13,5 @@ export interface RefundModalProps {
|
|
|
9
13
|
defaultValue?: number;
|
|
10
14
|
maxValue?: number;
|
|
11
15
|
}
|
|
12
|
-
export declare const RefundModal: ({ isVisible, onHide, onSubmit, isLoading,
|
|
16
|
+
export declare const RefundModal: ({ isVisible, onHide, onSubmit, isLoading, refundType, paymentType, defaultValue, maxValue, }: RefundModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
17
|
//# sourceMappingURL=RefundModal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefundModal.d.ts","sourceRoot":"","sources":["../../../../src/sales/modals/refund-modal/RefundModal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6DAA6D,CAAA;AAK9F,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,OAAO,CAAA;IAClB,
|
|
1
|
+
{"version":3,"file":"RefundModal.d.ts","sourceRoot":"","sources":["../../../../src/sales/modals/refund-modal/RefundModal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6DAA6D,CAAA;AAK9F,eAAO,MAAM,gBAAgB,eAAe,CAAA;AAC5C,eAAO,MAAM,mBAAmB,kBAAkB,CAAA;AAClD,eAAO,MAAM,eAAe,cAAc,CAAA;AAE1C,MAAM,MAAM,UAAU,GAClB,OAAO,gBAAgB,GACvB,OAAO,mBAAmB,GAC1B,OAAO,eAAe,CAAA;AAE1B,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,gBAAgB,CAAA;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAMD,eAAO,MAAM,WAAW,iGASrB,gBAAgB,4CAoGlB,CAAA"}
|
|
@@ -61,13 +61,17 @@ function _object_spread_props(target, source) {
|
|
|
61
61
|
}
|
|
62
62
|
return target;
|
|
63
63
|
}
|
|
64
|
+
var FULL_REFUND_TYPE = 'fullRefund';
|
|
65
|
+
var PARTIAL_REFUND_TYPE = 'partialRefund';
|
|
66
|
+
var NET_REFUND_TYPE = 'netRefund';
|
|
64
67
|
var RefundModal = function(param) {
|
|
65
|
-
var isVisible = param.isVisible, onHide = param.onHide, onSubmit = param.onSubmit, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading,
|
|
68
|
+
var isVisible = param.isVisible, onHide = param.onHide, onSubmit = param.onSubmit, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, _param_refundType = param.refundType, refundType = _param_refundType === void 0 ? PARTIAL_REFUND_TYPE : _param_refundType, paymentType = param.paymentType, _param_defaultValue = param.defaultValue, defaultValue = _param_defaultValue === void 0 ? 0 : _param_defaultValue, maxValue = param.maxValue;
|
|
66
69
|
var _errors_amount;
|
|
67
70
|
var t = useTranslation([
|
|
68
71
|
'Design',
|
|
69
72
|
'Validation'
|
|
70
73
|
]).t;
|
|
74
|
+
var isInputDisabled = isLoading || refundType === 'fullRefund' || refundType === 'netRefund';
|
|
71
75
|
var _useForm = useForm(), handleSubmit = _useForm.handleSubmit, register = _useForm.register, errors = _useForm.formState.errors, reset = _useForm.reset;
|
|
72
76
|
var onModalSubmit = function(param) {
|
|
73
77
|
var amount = param.amount;
|
|
@@ -97,7 +101,7 @@ var RefundModal = function(param) {
|
|
|
97
101
|
children: [
|
|
98
102
|
/*#__PURE__*/ jsx(ModalTitle, {
|
|
99
103
|
as: "h5",
|
|
100
|
-
children: t(
|
|
104
|
+
children: t("Design:".concat(refundType))
|
|
101
105
|
}),
|
|
102
106
|
/*#__PURE__*/ jsx(Button, {
|
|
103
107
|
variant: "danger",
|
|
@@ -150,7 +154,7 @@ var RefundModal = function(param) {
|
|
|
150
154
|
}
|
|
151
155
|
})), {
|
|
152
156
|
step: 0.01,
|
|
153
|
-
disabled:
|
|
157
|
+
disabled: isInputDisabled,
|
|
154
158
|
isInvalid: !!errors.amount,
|
|
155
159
|
min: 0
|
|
156
160
|
})),
|
|
@@ -186,4 +190,4 @@ var RefundModal = function(param) {
|
|
|
186
190
|
});
|
|
187
191
|
};
|
|
188
192
|
|
|
189
|
-
export { RefundModal };
|
|
193
|
+
export { FULL_REFUND_TYPE, NET_REFUND_TYPE, PARTIAL_REFUND_TYPE, RefundModal };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { RefundModal } from './RefundModal';
|
|
2
|
-
export type { RefundModalProps } from './RefundModal';
|
|
1
|
+
export { RefundModal, FULL_REFUND_TYPE, NET_REFUND_TYPE, PARTIAL_REFUND_TYPE, } from './RefundModal';
|
|
2
|
+
export type { RefundModalProps, RefundType } from './RefundModal';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sales/modals/refund-modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sales/modals/refund-modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,mBAAmB,GACpB,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -14,6 +14,7 @@ export interface SortableTreeItemProps {
|
|
|
14
14
|
body: ReactNode;
|
|
15
15
|
children?: ReactNode;
|
|
16
16
|
preItem?: ReactNode;
|
|
17
|
+
itemButton?: ReactNode;
|
|
17
18
|
postItem?: ReactNode;
|
|
18
19
|
sortableItems?: string[];
|
|
19
20
|
isExpanded?: boolean;
|
|
@@ -36,5 +37,5 @@ export interface SortableTreeItemProps {
|
|
|
36
37
|
setIsExpanded?: () => void;
|
|
37
38
|
isOverride?: boolean;
|
|
38
39
|
}
|
|
39
|
-
export declare function SortableTreeItem({ id, title, badge, subTitle, body, children, preItem, postItem, sortableItems, isExpanded, shouldExpand, isInvalid, isIconInHeader, treeLineIconColor, modalLabel, modalClass, isNewAdded, onDelete, validate, cancelChanges, saveValidField, edit, secondaryBadge, setIsExpanded, isOverride, }: SortableTreeItemProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function SortableTreeItem({ id, title, badge, subTitle, body, children, preItem, postItem, sortableItems, isExpanded, shouldExpand, isInvalid, isIconInHeader, treeLineIconColor, modalLabel, modalClass, isNewAdded, onDelete, validate, cancelChanges, saveValidField, edit, secondaryBadge, setIsExpanded, isOverride, itemButton, }: SortableTreeItemProps): import("react/jsx-runtime").JSX.Element;
|
|
40
41
|
//# sourceMappingURL=SortableTreeItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableTreeItem.d.ts","sourceRoot":"","sources":["../../src/sortable-tree/SortableTreeItem.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SortableTreeItem.d.ts","sourceRoot":"","sources":["../../src/sortable-tree/SortableTreeItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIV,MAAM,OAAO,CAAA;AAiBd,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAA;AAEV,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAA;AAEtE,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,UAAU,CAAC,EAAE,0BAA0B,CAAA;IACvC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IACjC,cAAc,CAAC,EAAE;QACf,KAAK,EAAE,MAAM,CAAA;QACb,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,aAAa,EACb,UAAkB,EAClB,YAAmB,EACnB,SAAiB,EACjB,cAAqB,EACrB,iBAAsB,EACtB,UAAe,EACf,UAAU,EACV,UAAkB,EAClB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,cAAc,EACd,IAAI,EACJ,cAAc,EACd,aAAa,EACb,UAAU,EACV,UAAU,GACX,EAAE,qBAAqB,2CA+TvB"}
|
|
@@ -240,7 +240,7 @@ var ProductSetModalClasses = {
|
|
|
240
240
|
productZones: 'edit-product-zone'
|
|
241
241
|
};
|
|
242
242
|
function SortableTreeItem(param) {
|
|
243
|
-
var id = param.id, title = param.title, badge = param.badge, subTitle = param.subTitle, body = param.body, children = param.children, preItem = param.preItem, postItem = param.postItem, sortableItems = param.sortableItems, _param_isExpanded = param.isExpanded, isExpanded = _param_isExpanded === void 0 ? false : _param_isExpanded, _param_shouldExpand = param.shouldExpand, shouldExpand = _param_shouldExpand === void 0 ? true : _param_shouldExpand, _param_isInvalid = param.isInvalid, isInvalid = _param_isInvalid === void 0 ? false : _param_isInvalid, _param_isIconInHeader = param.isIconInHeader, isIconInHeader = _param_isIconInHeader === void 0 ? true : _param_isIconInHeader, _param_treeLineIconColor = param.treeLineIconColor, treeLineIconColor = _param_treeLineIconColor === void 0 ? '' : _param_treeLineIconColor, _param_modalLabel = param.modalLabel, modalLabel = _param_modalLabel === void 0 ? '' : _param_modalLabel, modalClass = param.modalClass, _param_isNewAdded = param.isNewAdded, isNewAdded = _param_isNewAdded === void 0 ? false : _param_isNewAdded, onDelete = param.onDelete, validate = param.validate, cancelChanges = param.cancelChanges, saveValidField = param.saveValidField, edit = param.edit, secondaryBadge = param.secondaryBadge, setIsExpanded = param.setIsExpanded, isOverride = param.isOverride;
|
|
243
|
+
var id = param.id, title = param.title, badge = param.badge, subTitle = param.subTitle, body = param.body, children = param.children, preItem = param.preItem, postItem = param.postItem, sortableItems = param.sortableItems, _param_isExpanded = param.isExpanded, isExpanded = _param_isExpanded === void 0 ? false : _param_isExpanded, _param_shouldExpand = param.shouldExpand, shouldExpand = _param_shouldExpand === void 0 ? true : _param_shouldExpand, _param_isInvalid = param.isInvalid, isInvalid = _param_isInvalid === void 0 ? false : _param_isInvalid, _param_isIconInHeader = param.isIconInHeader, isIconInHeader = _param_isIconInHeader === void 0 ? true : _param_isIconInHeader, _param_treeLineIconColor = param.treeLineIconColor, treeLineIconColor = _param_treeLineIconColor === void 0 ? '' : _param_treeLineIconColor, _param_modalLabel = param.modalLabel, modalLabel = _param_modalLabel === void 0 ? '' : _param_modalLabel, modalClass = param.modalClass, _param_isNewAdded = param.isNewAdded, isNewAdded = _param_isNewAdded === void 0 ? false : _param_isNewAdded, onDelete = param.onDelete, validate = param.validate, cancelChanges = param.cancelChanges, saveValidField = param.saveValidField, edit = param.edit, secondaryBadge = param.secondaryBadge, setIsExpanded = param.setIsExpanded, isOverride = param.isOverride, itemButton = param.itemButton;
|
|
244
244
|
var _useState = _sliced_to_array(useState(isExpanded), 2), expanded = _useState[0], setExpanded = _useState[1];
|
|
245
245
|
var _useState1 = _sliced_to_array(useState(isNewAdded), 2), isModalVisible = _useState1[0], setIsModalVisible = _useState1[1];
|
|
246
246
|
var t = useTranslation('Design').t;
|
|
@@ -433,9 +433,15 @@ function SortableTreeItem(param) {
|
|
|
433
433
|
/*#__PURE__*/ jsxs("div", {
|
|
434
434
|
className: clsx(modalLabel ? 'sortable-tree-product-set-title-container' : 'sortable-tree-title-container'),
|
|
435
435
|
children: [
|
|
436
|
-
/*#__PURE__*/
|
|
437
|
-
className: clsx('sortable-tree-item-title', modalLabel && 'sortable-tree-product-set-element-title'),
|
|
438
|
-
children:
|
|
436
|
+
/*#__PURE__*/ jsxs("span", {
|
|
437
|
+
className: clsx('sortable-tree-item-title', modalLabel && 'sortable-tree-product-set-element-title', 'd-flex justify-content-between'),
|
|
438
|
+
children: [
|
|
439
|
+
title,
|
|
440
|
+
/*#__PURE__*/ jsx("div", {
|
|
441
|
+
className: "sortable-tree-item-subtitle",
|
|
442
|
+
children: itemButton
|
|
443
|
+
})
|
|
444
|
+
]
|
|
439
445
|
}),
|
|
440
446
|
!expanded && /*#__PURE__*/ jsx("span", {
|
|
441
447
|
className: "sortable-tree-item-subtitle",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.product-set-form {
|
|
2
|
+
|
|
2
3
|
input,
|
|
3
4
|
textarea,
|
|
4
5
|
select,
|
|
@@ -15,10 +16,12 @@
|
|
|
15
16
|
height: 2.5rem;
|
|
16
17
|
border-width: 2px;
|
|
17
18
|
padding: 2px;
|
|
19
|
+
|
|
18
20
|
label,
|
|
19
21
|
.btn-switch-indicator {
|
|
20
22
|
border-radius: 0.375rem !important;
|
|
21
23
|
}
|
|
24
|
+
|
|
22
25
|
label {
|
|
23
26
|
height: 2rem;
|
|
24
27
|
}
|
|
@@ -34,6 +37,7 @@
|
|
|
34
37
|
margin-top: 1.5rem;
|
|
35
38
|
margin-bottom: 1.5rem;
|
|
36
39
|
}
|
|
40
|
+
|
|
37
41
|
@include media-breakpoint-down(sm) {
|
|
38
42
|
padding: 1.5rem 1rem;
|
|
39
43
|
margin-top: 0.5rem;
|
|
@@ -59,10 +63,21 @@
|
|
|
59
63
|
background-color: #ffdbdb;
|
|
60
64
|
color: #d52902;
|
|
61
65
|
}
|
|
66
|
+
|
|
62
67
|
.category-badge {
|
|
63
68
|
background-color: #e8f4f6;
|
|
64
69
|
color: #1a93aa;
|
|
65
70
|
}
|
|
71
|
+
|
|
72
|
+
.item-icon {
|
|
73
|
+
display: flex;
|
|
74
|
+
justify-items: center;
|
|
75
|
+
align-items: center;
|
|
76
|
+
font-size: 0.65rem;
|
|
77
|
+
padding: 0.2rem;
|
|
78
|
+
margin-right: 1rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
66
81
|
.product-badge {
|
|
67
82
|
background-color: #e9f5ea;
|
|
68
83
|
color: #269b36;
|
|
@@ -75,10 +90,12 @@
|
|
|
75
90
|
|
|
76
91
|
.product-set-mobile-modal {
|
|
77
92
|
margin: 0;
|
|
93
|
+
|
|
78
94
|
.modal-content {
|
|
79
95
|
border-radius: 1rem 1rem 0 0;
|
|
80
96
|
border-width: 0;
|
|
81
97
|
margin: 0;
|
|
98
|
+
|
|
82
99
|
.modal-body {
|
|
83
100
|
padding: 1rem 0;
|
|
84
101
|
}
|
|
@@ -100,18 +117,22 @@
|
|
|
100
117
|
font-weight: 600;
|
|
101
118
|
font-size: 0.625rem;
|
|
102
119
|
}
|
|
120
|
+
|
|
103
121
|
.product-set-subtitle-dot {
|
|
104
122
|
margin-right: 0.375rem;
|
|
105
123
|
width: 0.375rem;
|
|
106
124
|
height: 0.375rem;
|
|
107
125
|
border-radius: 3px;
|
|
108
126
|
}
|
|
127
|
+
|
|
109
128
|
.product-set-subtitle-category-dot {
|
|
110
129
|
background-color: #269b36;
|
|
111
130
|
}
|
|
131
|
+
|
|
112
132
|
.product-set-subtitle-step-dot {
|
|
113
133
|
background-color: #1a93aa;
|
|
114
134
|
}
|
|
135
|
+
|
|
115
136
|
.product-set-subtitle-product-dot {
|
|
116
137
|
background-color: #269b36;
|
|
117
138
|
}
|
|
@@ -156,6 +177,7 @@
|
|
|
156
177
|
justify-self: flex-end;
|
|
157
178
|
align-items: flex-end;
|
|
158
179
|
}
|
|
180
|
+
|
|
159
181
|
.small-badge {
|
|
160
182
|
font-size: 0.5rem;
|
|
161
183
|
height: 1rem;
|
|
@@ -163,6 +185,7 @@
|
|
|
163
185
|
padding: 0 0.2rem;
|
|
164
186
|
margin-bottom: 0.2rem;
|
|
165
187
|
}
|
|
188
|
+
|
|
166
189
|
.product-set-save-btn-wrapper {
|
|
167
190
|
padding-left: 0 !important;
|
|
168
191
|
display: flex;
|
|
@@ -177,8 +200,8 @@
|
|
|
177
200
|
|
|
178
201
|
.sortable-tree-item-toggle {
|
|
179
202
|
.product-zone-badge {
|
|
180
|
-
background-color: #
|
|
181
|
-
color: #
|
|
203
|
+
background-color: #EFE9F5;
|
|
204
|
+
color: #84269B;
|
|
182
205
|
font-size: 0.875rem;
|
|
183
206
|
font-weight: 600;
|
|
184
207
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.22",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -206,4 +206,4 @@
|
|
|
206
206
|
"node": "20.9.0",
|
|
207
207
|
"yarn": "4.4.0"
|
|
208
208
|
}
|
|
209
|
-
}
|
|
209
|
+
}
|
|
@@ -27,7 +27,6 @@ export const GridView: Story<ActivityCardProps> = (props) => {
|
|
|
27
27
|
GridView.args = {
|
|
28
28
|
layout: LAYOUT_GRID,
|
|
29
29
|
title: 'Clay Pigeons & Axe Thowing',
|
|
30
|
-
duration: '60 mins',
|
|
31
30
|
price: 'from £20',
|
|
32
31
|
}
|
|
33
32
|
|
|
@@ -46,6 +45,5 @@ export const ListView: Story<ActivityCardProps> = (props) => {
|
|
|
46
45
|
ListView.args = {
|
|
47
46
|
layout: LAYOUT_LIST,
|
|
48
47
|
title: 'Clay Pigeons & Axe Thowing',
|
|
49
|
-
duration: '60 mins',
|
|
50
48
|
price: 'from £20',
|
|
51
49
|
}
|
|
@@ -10,7 +10,6 @@ export const LAYOUT_LIST = 'list'
|
|
|
10
10
|
|
|
11
11
|
export type ActivityCardProps = {
|
|
12
12
|
title: ReactNode
|
|
13
|
-
duration: ReactNode
|
|
14
13
|
price: ReactNode
|
|
15
14
|
description?: ReactNode
|
|
16
15
|
onSelect: () => void
|
|
@@ -24,7 +23,6 @@ export type ActivityCardProps = {
|
|
|
24
23
|
|
|
25
24
|
export const ActivityCard = ({
|
|
26
25
|
title,
|
|
27
|
-
duration,
|
|
28
26
|
price,
|
|
29
27
|
description,
|
|
30
28
|
availableTimes,
|
|
@@ -48,7 +46,6 @@ export const ActivityCard = ({
|
|
|
48
46
|
|
|
49
47
|
<div>
|
|
50
48
|
<div className='activity-card-title'>{title}</div>
|
|
51
|
-
{duration && <div>{duration}</div>}
|
|
52
49
|
{price && <div>{price}</div>}
|
|
53
50
|
{description && (
|
|
54
51
|
<div className='mt-2 activity-card-description'>{description}</div>
|
|
@@ -79,7 +76,6 @@ export const ActivityCard = ({
|
|
|
79
76
|
<div className='activity-card-info'>
|
|
80
77
|
<div className='activity-card-title mb-2'>{title}</div>
|
|
81
78
|
{availableTimes && <div>{availableTimes}</div>}
|
|
82
|
-
{duration && <div>{duration}</div>}
|
|
83
79
|
{price && <div>{price}</div>}
|
|
84
80
|
{description && (
|
|
85
81
|
<div className='mt-2 activity-card-description'>{description}</div>
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
useFormContext,
|
|
9
9
|
useWatch,
|
|
10
10
|
} from 'react-hook-form'
|
|
11
|
+
import { FaBars, FaBowlingBall, FaCalendar, FaTicketAlt } from 'react-icons/fa'
|
|
11
12
|
import { useTranslation } from 'react-i18next'
|
|
12
13
|
import { useSensor, MouseSensor } from '@dnd-kit/core'
|
|
13
14
|
import {
|
|
@@ -25,7 +26,11 @@ import { ProductCategoryControl } from '../product-category'
|
|
|
25
26
|
import { ProductCategory } from '../types'
|
|
26
27
|
import { ProductsControl } from './ProductsControl'
|
|
27
28
|
import { ProductSetFormValues, WithIsLoading } from './ProductSetForm'
|
|
28
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
SelectCategoryModal,
|
|
31
|
+
CATEGORY_TYPES_NAMES,
|
|
32
|
+
CategoryConfig,
|
|
33
|
+
} from './SelectCategoryModal'
|
|
29
34
|
import { ProductSetLoadingContext } from './context'
|
|
30
35
|
import { VenueMapSetModal } from './VenueMapSetModal'
|
|
31
36
|
import { moveArrayElements, sortArrayByIndex } from '../utils'
|
|
@@ -33,6 +38,29 @@ import { useSortableTreeFunctions } from '../hooks/useSortableTreeFunctions'
|
|
|
33
38
|
// @TODO not for first release
|
|
34
39
|
// import Popover from "./ProductSetFormPopover";
|
|
35
40
|
|
|
41
|
+
const CATEGORIES_TYPE: Partial<Record<CategoryType, CategoryConfig>> = {
|
|
42
|
+
[CATEGORY_TYPES_NAMES.tickets]: {
|
|
43
|
+
label: 'tickets',
|
|
44
|
+
icon: <FaTicketAlt color='#0e8ce2' size={10} />,
|
|
45
|
+
},
|
|
46
|
+
[CATEGORY_TYPES_NAMES.bookings]: {
|
|
47
|
+
label: 'bookings',
|
|
48
|
+
icon: <FaCalendar color='#0e8ce2' size={10} />,
|
|
49
|
+
},
|
|
50
|
+
[CATEGORY_TYPES_NAMES.menuItems]: {
|
|
51
|
+
label: 'menuItems',
|
|
52
|
+
icon: <FaBars color='#0e8ce2' size={10} />,
|
|
53
|
+
},
|
|
54
|
+
[CATEGORY_TYPES_NAMES.game]: {
|
|
55
|
+
label: 'game',
|
|
56
|
+
icon: <FaBowlingBall color='#0e8ce2' size={10} />,
|
|
57
|
+
},
|
|
58
|
+
[CATEGORY_TYPES_NAMES.fixedDuration]: {
|
|
59
|
+
label: 'fixedDuration',
|
|
60
|
+
icon: <FaCalendar color='#0e8ce2' size={10} />,
|
|
61
|
+
},
|
|
62
|
+
}
|
|
63
|
+
|
|
36
64
|
interface ProductCategoriesControlProps extends WithIsLoading {
|
|
37
65
|
stepIndex: number
|
|
38
66
|
isOverrides?: boolean
|
|
@@ -229,6 +257,8 @@ export function ProductCategoriesControl({
|
|
|
229
257
|
setIsExpanded(productCategoryId)
|
|
230
258
|
}
|
|
231
259
|
|
|
260
|
+
const categoryType = CATEGORIES_TYPE[productCategory.type]
|
|
261
|
+
|
|
232
262
|
return (
|
|
233
263
|
<Controller
|
|
234
264
|
key={`product-category-${productCategory._id}`}
|
|
@@ -273,6 +303,12 @@ export function ProductCategoriesControl({
|
|
|
273
303
|
)}
|
|
274
304
|
modalClass={ProductSetModalClasses.category}
|
|
275
305
|
isNewAdded={showCategoryModal}
|
|
306
|
+
itemButton={
|
|
307
|
+
<div className='btn-outline-primary item-icon sm border border-primary rounded-sm'>
|
|
308
|
+
{categoryType.icon}
|
|
309
|
+
<span className='ml-2'>{t(categoryType.label)}</span>
|
|
310
|
+
</div>
|
|
311
|
+
}
|
|
276
312
|
body={
|
|
277
313
|
<ProductCategoryControl
|
|
278
314
|
isLoading={isLoading}
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from 'react-icons/fa'
|
|
26
26
|
import { ProductSetLoadingContext } from './context'
|
|
27
27
|
|
|
28
|
-
const CATEGORY_TYPES_NAMES = {
|
|
28
|
+
export const CATEGORY_TYPES_NAMES = {
|
|
29
29
|
menuItems: CATEGORY_TYPE_MENU_ITEMS,
|
|
30
30
|
tickets: CATEGORY_TYPE_TICKETS,
|
|
31
31
|
bookings: CATEGORY_TYPE_BOOKINGS,
|
|
@@ -33,7 +33,7 @@ const CATEGORY_TYPES_NAMES = {
|
|
|
33
33
|
fixedDuration: CATEGORY_TYPE_FIXED_DURATION,
|
|
34
34
|
} as const
|
|
35
35
|
|
|
36
|
-
type CategoryConfig = { label: string; icon: ReactElement }
|
|
36
|
+
export type CategoryConfig = { label: string; icon: ReactElement }
|
|
37
37
|
|
|
38
38
|
const MAIN_CATEGORIES: Partial<Record<CategoryType, CategoryConfig>> = {
|
|
39
39
|
[CATEGORY_TYPES_NAMES.tickets]: {
|