@licklist/design 0.71.21 → 0.71.23
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/events/event-statistic-modal/utils/index.js +3 -3
- 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/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/product-set/ProductSetForm.scss +25 -2
- package/package.json +2 -2
- package/src/events/event-statistic-modal/utils/index.ts +4 -4
- package/src/product-set/form/ProductCategoriesControl.tsx +37 -1
- package/src/product-set/form/SelectCategoryModal.tsx +2 -2
- package/src/sortable-tree/SortableTreeItem.tsx +12 -1
- package/src/styles/product-set/ProductSetForm.scss +25 -2
- package/yarn.lock +285 -285
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DateTime } from 'luxon';
|
|
2
|
-
import {
|
|
2
|
+
import { DATE_TIME_FULL_FORMAT } from '@licklist/core/dist/Config';
|
|
3
3
|
import { maxBy } from 'lodash';
|
|
4
4
|
|
|
5
5
|
function _array_like_to_array(arr, len) {
|
|
@@ -39,10 +39,10 @@ var convertEventStatisticToTableData = function(date, eventStatistic) {
|
|
|
39
39
|
if (!eventStatistic) {
|
|
40
40
|
return [];
|
|
41
41
|
}
|
|
42
|
-
var summaryFormattedDate = DateTime.fromISO(date).
|
|
42
|
+
var summaryFormattedDate = DateTime.fromISO(date).toFormat(DATE_TIME_FULL_FORMAT);
|
|
43
43
|
var _Object_keys_filter;
|
|
44
44
|
var summaryDays = (_Object_keys_filter = (_Object_keys = Object.keys(eventStatistic === null || eventStatistic === void 0 ? void 0 : eventStatistic.productCategorySummary)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.filter(function(date) {
|
|
45
|
-
return DateTime.fromFormat(date, DATE_TIME_FULL_FORMAT).toFormat(
|
|
45
|
+
return DateTime.fromFormat(date, DATE_TIME_FULL_FORMAT).toFormat(DATE_TIME_FULL_FORMAT) === summaryFormattedDate;
|
|
46
46
|
})) !== null && _Object_keys_filter !== void 0 ? _Object_keys_filter : [];
|
|
47
47
|
var summaryMap = new Map();
|
|
48
48
|
summaryDays.map(function(day) {
|
|
@@ -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"}
|
|
@@ -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.23",
|
|
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
|
+
}
|
|
@@ -33,15 +33,15 @@ export const convertEventStatisticToTableData = (
|
|
|
33
33
|
return []
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const summaryFormattedDate = DateTime.fromISO(date)
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const summaryFormattedDate = DateTime.fromISO(date).toFormat(
|
|
37
|
+
DATE_TIME_FULL_FORMAT,
|
|
38
|
+
)
|
|
39
39
|
|
|
40
40
|
const summaryDays =
|
|
41
41
|
Object.keys(eventStatistic?.productCategorySummary)?.filter(
|
|
42
42
|
(date) =>
|
|
43
43
|
DateTime.fromFormat(date, DATE_TIME_FULL_FORMAT).toFormat(
|
|
44
|
-
|
|
44
|
+
DATE_TIME_FULL_FORMAT,
|
|
45
45
|
) === summaryFormattedDate,
|
|
46
46
|
) ?? []
|
|
47
47
|
|
|
@@ -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]: {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ReactNode,
|
|
3
|
+
useCallback,
|
|
4
|
+
useEffect,
|
|
5
|
+
useState,
|
|
6
|
+
} from 'react'
|
|
2
7
|
import { DndContext, useDraggable } from '@dnd-kit/core'
|
|
3
8
|
import {
|
|
4
9
|
SortableContext,
|
|
@@ -33,6 +38,7 @@ export interface SortableTreeItemProps {
|
|
|
33
38
|
body: ReactNode
|
|
34
39
|
children?: ReactNode
|
|
35
40
|
preItem?: ReactNode
|
|
41
|
+
itemButton?: ReactNode
|
|
36
42
|
postItem?: ReactNode
|
|
37
43
|
sortableItems?: string[]
|
|
38
44
|
isExpanded?: boolean
|
|
@@ -82,6 +88,7 @@ export function SortableTreeItem({
|
|
|
82
88
|
secondaryBadge,
|
|
83
89
|
setIsExpanded,
|
|
84
90
|
isOverride,
|
|
91
|
+
itemButton,
|
|
85
92
|
}: SortableTreeItemProps) {
|
|
86
93
|
const [expanded, setExpanded] = useState(isExpanded)
|
|
87
94
|
const [isModalVisible, setIsModalVisible] = useState(isNewAdded)
|
|
@@ -287,9 +294,13 @@ export function SortableTreeItem({
|
|
|
287
294
|
className={clsx(
|
|
288
295
|
'sortable-tree-item-title',
|
|
289
296
|
modalLabel && 'sortable-tree-product-set-element-title',
|
|
297
|
+
'd-flex justify-content-between',
|
|
290
298
|
)}
|
|
291
299
|
>
|
|
292
300
|
{title}
|
|
301
|
+
<div className='sortable-tree-item-subtitle'>
|
|
302
|
+
{itemButton}
|
|
303
|
+
</div>
|
|
293
304
|
</span>
|
|
294
305
|
{!expanded && (
|
|
295
306
|
<span 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
|
}
|