@licklist/design 0.68.0-dev.1 → 0.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.cjs +12 -15
- package/dist/assets/iframe/selectArrow.svg.js +17 -0
- package/dist/auth/Login/LoginComponent.js +1 -2
- package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts.map +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.js +40 -35
- package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.js +1 -7
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +23 -24
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -0
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +0 -2
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/layout/DropDown.d.ts +1 -2
- package/dist/layout/DropDown.d.ts.map +1 -1
- package/dist/modals/confirmation/ConfirmModal.d.ts +1 -3
- package/dist/modals/confirmation/ConfirmModal.d.ts.map +1 -1
- package/dist/modals/confirmation/ConfirmModal.js +8 -172
- package/dist/product-set/card/ProductSetCard.d.ts +2 -6
- package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
- package/dist/product-set/card/ProductSetCard.js +11 -30
- package/dist/product-set/control/DateInput.d.ts.map +1 -1
- package/dist/product-set/control/DateInput.js +2 -2
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +2 -48
- package/dist/product-set/form/ProductSetForm.d.ts +1 -4
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +1 -59
- package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductZonesControl.js +2 -0
- package/dist/product-set/form/SelectCategoryModal.d.ts +0 -12
- package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
- package/dist/product-set/form/SelectCategoryModal.js +1 -1
- package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/SubProductsControl.js +3 -0
- package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
- package/dist/product-set/form/VenueMapsControl.js +3 -0
- package/dist/product-set/form/index.d.ts +0 -1
- package/dist/product-set/form/index.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/utils/index.d.ts +0 -7
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +1 -10
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +2 -3
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +2 -0
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +0 -6
- package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +4 -10
- package/dist/styles/auth/AccessDenied.scss +1 -1
- package/dist/styles/back-button/BackButton.scss +24 -25
- package/dist/styles/back-button/_index.scss +1 -1
- package/dist/styles/company-user-form/UserForm.scss +7 -4
- package/dist/styles/company-user-form/_index.scss +1 -1
- package/dist/styles/custom-fields/CreateSortableListItem.scss +1 -2
- package/dist/styles/custom-fields/_index.scss +1 -1
- package/dist/styles/customers/Filter.scss +5 -5
- package/dist/styles/events/EditEventModal.scss +3 -1
- package/dist/styles/events/EventVenueMap.scss +7 -7
- package/dist/styles/form/Input.scss +1 -1
- package/dist/styles/header/Header.scss +1 -1
- package/dist/styles/header/elements/CompanySelector.scss +2 -2
- package/dist/styles/iframe-events/Calendar.scss +1 -0
- package/dist/styles/iframe-events/CalendarSelect.scss +1 -1
- package/dist/styles/iframe-events/CategoryStepsForm.scss +7 -6
- package/dist/styles/iframe-events/Event.scss +4 -2
- package/dist/styles/iframe-events/EventForm.scss +54 -54
- package/dist/styles/iframe-events/EventNavigationFooter.scss +0 -1
- package/dist/styles/iframe-events/TicketDescription.scss +1 -1
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/iframe-payments/PaymentForm.scss +1 -1
- package/dist/styles/layout/BackgroundVideoContainer.scss +2 -2
- package/dist/styles/notification/Notification.scss +1 -1
- package/dist/styles/order-items-table/OrderItemsTable.scss +2 -1
- package/dist/styles/product-set/CreateProductSetItem.scss +13 -15
- package/dist/styles/product-set/DateAndRecurrenceInput.scss +8 -6
- package/dist/styles/product-set/EditCategoryModal.scss +4 -4
- package/dist/styles/product-set/EditProductModal.scss +3 -3
- package/dist/styles/product-set/EditStepModal.scss +4 -4
- package/dist/styles/product-set/EditVenueMapSetModal.scss +6 -6
- package/dist/styles/product-set/ProductSetForm.scss +2 -25
- package/dist/styles/product-set/TutorialGifCard.scss +1 -1
- package/dist/styles/product-set/_index.scss +2 -2
- package/dist/styles/report/ReportCard.scss +0 -1
- package/dist/styles/report/_index.scss +1 -1
- package/dist/styles/resources-blocking/_index.scss +0 -4
- package/dist/styles/sales/BookingFilter.scss +2 -2
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/BookingTabs.scss +5 -7
- package/dist/styles/sales/Filters.scss +4 -5
- package/dist/styles/sales/GuestProfile.scss +175 -170
- package/dist/styles/sales/LifeTimeSales.scss +1 -1
- package/dist/styles/sales/ManualBooking.scss +2 -4
- package/dist/styles/snippet-templates/_snippetVariables.scss +244 -63
- package/dist/styles/sortable-field/SortableField.scss +16 -16
- package/dist/styles/sortable-field/_index.scss +1 -1
- package/dist/styles/sortable-tree/Item.scss +4 -4
- package/dist/styles/table/Table.scss +1 -1
- package/dist/styles/themes/bookedit/_variables.scss +32 -10
- package/dist/styles/themes/licklist/_variables.scss +1 -1
- package/dist/styles/tiptap-editor/TiptapEditor.scss +10 -9
- package/dist/styles/tiptap-editor/_index.scss +1 -1
- package/dist/styles/venue-map-sets/VenueMapSetForm.scss +4 -5
- package/dist/styles/virtualized/_index.scss +1 -1
- package/dist/styles/zones/ZoneRecurrencesControl.scss +8 -6
- package/dist/typeahead/Typeahead.d.ts +1 -5
- package/dist/typeahead/Typeahead.d.ts.map +1 -1
- package/dist/typeahead/Typeahead.js +2 -9
- package/package.json +6 -8
- package/src/auth/ChangePassword/ChangePassword.stories.tsx +1 -1
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/auth/ResetPassword/ResetPassword.stories.tsx +1 -1
- package/src/calendar/components/CalendarButtons/CalendarButtons.tsx +28 -31
- package/src/events/edit-event-modal/IntervalInput.tsx +1 -8
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +34 -32
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
- package/src/header/elements/Elements.stories.tsx +1 -1
- package/src/help/popover/Popover.stories.tsx +1 -1
- package/src/iframe/event/event-venue-map/IframeEventVenueMap.stories.tsx +3 -3
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +0 -1
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +0 -1
- package/src/layout/DropDown.tsx +1 -2
- package/src/modals/confirmation/ConfirmModal.tsx +3 -19
- package/src/product-set/card/ProductSetCard.stories.tsx +1 -3
- package/src/product-set/card/ProductSetCard.tsx +8 -47
- package/src/product-set/control/DateInput.tsx +1 -2
- package/src/product-set/control/ProductSetRecurrenceControl.stories.tsx +2 -2
- package/src/product-set/form/ProductCategoriesControl.tsx +1 -37
- package/src/product-set/form/ProductSetForm.tsx +3 -18
- package/src/product-set/form/ProductZonesControl.tsx +7 -4
- package/src/product-set/form/SelectCategoryModal.stories.tsx +1 -1
- package/src/product-set/form/SelectCategoryModal.tsx +2 -2
- package/src/product-set/form/SubProductsControl.tsx +3 -0
- package/src/product-set/form/VenueMapsControl.tsx +3 -0
- package/src/product-set/form/index.ts +0 -1
- package/src/product-set/product/ProductControl.tsx +5 -1
- package/src/product-set/product/advanced-options/AdvancedOptions.tsx +5 -5
- package/src/product-set/product/booking-management/ProductBookingManagement.stories.tsx +1 -1
- package/src/product-set/product/quantity/ProductQuantity.stories.tsx +1 -1
- package/src/product-set/product-zone/ProductZoneControl.tsx +9 -9
- package/src/product-set/utils/index.ts +0 -11
- package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +2 -2
- package/src/sales/booking/results/components/ResultCard.tsx +2 -0
- package/src/setting/admin/AdminSetting.stories.tsx +0 -1
- package/src/setting/system/SystemSetting.stories.tsx +1 -1
- package/src/snippet/snippet-template/preview/Preview.tsx +0 -6
- package/src/sortable-tree/SortableTreeItem.tsx +0 -6
- package/src/styles/auth/AccessDenied.scss +1 -1
- package/src/styles/back-button/BackButton.scss +24 -25
- package/src/styles/back-button/_index.scss +1 -1
- package/src/styles/company-user-form/UserForm.scss +7 -4
- package/src/styles/company-user-form/_index.scss +1 -1
- package/src/styles/custom-fields/CreateSortableListItem.scss +1 -2
- package/src/styles/custom-fields/_index.scss +1 -1
- package/src/styles/customers/Filter.scss +5 -5
- package/src/styles/events/EditEventModal.scss +3 -1
- package/src/styles/events/EventVenueMap.scss +7 -7
- package/src/styles/form/Input.scss +1 -1
- package/src/styles/header/Header.scss +1 -1
- package/src/styles/header/elements/CompanySelector.scss +2 -2
- package/src/styles/iframe-events/Calendar.scss +1 -0
- package/src/styles/iframe-events/CalendarSelect.scss +1 -1
- package/src/styles/iframe-events/CategoryStepsForm.scss +7 -6
- package/src/styles/iframe-events/Event.scss +4 -2
- package/src/styles/iframe-events/EventForm.scss +54 -54
- package/src/styles/iframe-events/EventNavigationFooter.scss +0 -1
- package/src/styles/iframe-events/TicketDescription.scss +1 -1
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/iframe-payments/PaymentForm.scss +1 -1
- package/src/styles/layout/BackgroundVideoContainer.scss +2 -2
- package/src/styles/notification/Notification.scss +1 -1
- package/src/styles/order-items-table/OrderItemsTable.scss +2 -1
- package/src/styles/product-set/CreateProductSetItem.scss +13 -15
- package/src/styles/product-set/DateAndRecurrenceInput.scss +8 -6
- package/src/styles/product-set/EditCategoryModal.scss +4 -4
- package/src/styles/product-set/EditProductModal.scss +3 -3
- package/src/styles/product-set/EditStepModal.scss +4 -4
- package/src/styles/product-set/EditVenueMapSetModal.scss +6 -6
- package/src/styles/product-set/ProductSetForm.scss +2 -25
- package/src/styles/product-set/TutorialGifCard.scss +1 -1
- package/src/styles/product-set/_index.scss +2 -2
- package/src/styles/report/ReportCard.scss +0 -1
- package/src/styles/report/_index.scss +1 -1
- package/src/styles/resources-blocking/_index.scss +0 -4
- package/src/styles/sales/BookingFilter.scss +2 -2
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/BookingTabs.scss +5 -7
- package/src/styles/sales/Filters.scss +4 -5
- package/src/styles/sales/GuestProfile.scss +175 -170
- package/src/styles/sales/LifeTimeSales.scss +1 -1
- package/src/styles/sales/ManualBooking.scss +2 -4
- package/src/styles/snippet-templates/_snippetVariables.scss +244 -63
- package/src/styles/sortable-field/SortableField.scss +16 -16
- package/src/styles/sortable-field/_index.scss +1 -1
- package/src/styles/sortable-tree/Item.scss +4 -4
- package/src/styles/table/Table.scss +1 -1
- package/src/styles/themes/bookedit/_variables.scss +32 -10
- package/src/styles/themes/licklist/_variables.scss +1 -1
- package/src/styles/tiptap-editor/TiptapEditor.scss +10 -9
- package/src/styles/tiptap-editor/_index.scss +1 -1
- package/src/styles/venue-map-sets/VenueMapSetForm.scss +4 -5
- package/src/styles/virtualized/_index.scss +1 -1
- package/src/styles/zones/ZoneRecurrencesControl.scss +8 -6
- package/src/tiptap-editor/TipTapEditor.stories.tsx +4 -6
- package/src/tiptap-editor/TipTapMenu/TipTapMenu.stories.tsx +2 -5
- package/src/typeahead/Typeahead.tsx +1 -15
- package/yarn.lock +14 -40
- package/dist/product-set/form/ProductSetNameControl.d.ts +0 -6
- package/dist/product-set/form/ProductSetNameControl.d.ts.map +0 -1
- package/dist/product-set/form/ProductSetNameControl.js +0 -35
- package/src/product-set/form/ProductSetNameControl.tsx +0 -27
|
@@ -31,7 +31,7 @@ function _object_spread(target) {
|
|
|
31
31
|
return target;
|
|
32
32
|
}
|
|
33
33
|
function Typeahead(param) {
|
|
34
|
-
var options = param.options, placeholder = param.placeholder, _param_isRequired = param.isRequired, isRequired = _param_isRequired === void 0 ? false : _param_isRequired, isMultipleChoise = param.isMultipleChoise, _param_name = param.name, name = _param_name === void 0 ? "" : _param_name,
|
|
34
|
+
var options = param.options, placeholder = param.placeholder, _param_isRequired = param.isRequired, isRequired = _param_isRequired === void 0 ? false : _param_isRequired, isMultipleChoise = param.isMultipleChoise, _param_name = param.name, name = _param_name === void 0 ? "" : _param_name, _param_isCouponForm = param.isCouponForm, isCouponForm = _param_isCouponForm === void 0 ? false : _param_isCouponForm, _param_noOptionsMessage = param.noOptionsMessage, noOptionsMessage = _param_noOptionsMessage === void 0 ? "" : _param_noOptionsMessage, isInvalid = param.isInvalid;
|
|
35
35
|
var control = useFormContext().control;
|
|
36
36
|
var getStyle = function() {
|
|
37
37
|
var couponFormStyle = isCouponForm ? {
|
|
@@ -53,21 +53,14 @@ function Typeahead(param) {
|
|
|
53
53
|
var field = param.field;
|
|
54
54
|
return /*#__PURE__*/ jsx(Select, {
|
|
55
55
|
placeholder: placeholder,
|
|
56
|
-
value:
|
|
56
|
+
value: field.value,
|
|
57
57
|
isMulti: isMultipleChoise,
|
|
58
58
|
styles: {
|
|
59
|
-
container: function(base) {
|
|
60
|
-
return _object_spread({}, base, containerStyles);
|
|
61
|
-
},
|
|
62
59
|
control: function(base) {
|
|
63
60
|
return _object_spread({}, base, getStyle());
|
|
64
61
|
}
|
|
65
62
|
},
|
|
66
63
|
onChange: function(value) {
|
|
67
|
-
if (onChangeValue) {
|
|
68
|
-
onChangeValue(value);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
64
|
field.onChange(value);
|
|
72
65
|
},
|
|
73
66
|
options: options,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.68.0
|
|
3
|
+
"version": "0.68.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@licklist/core": "0.
|
|
45
|
+
"@licklist/core": "0.30.0",
|
|
46
46
|
"@licklist/eslint-config": "0.5.5",
|
|
47
|
-
"@licklist/plugins": "0.
|
|
47
|
+
"@licklist/plugins": "0.33.0",
|
|
48
48
|
"lodash": "4.17.21",
|
|
49
49
|
"luxon": "3.5.0",
|
|
50
50
|
"react": "17.0.2",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"@dnd-kit/utilities": "2.0.0",
|
|
62
62
|
"@fortawesome/fontawesome-svg-core": "1.2.34",
|
|
63
63
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
64
|
-
"@licklist/core": "0.
|
|
64
|
+
"@licklist/core": "0.30.0",
|
|
65
65
|
"@licklist/eslint-config": "0.5.5",
|
|
66
|
-
"@licklist/plugins": "0.
|
|
66
|
+
"@licklist/plugins": "0.33.0",
|
|
67
67
|
"@mdx-js/react": "1.6.22",
|
|
68
68
|
"@popperjs/core": "2.11.8",
|
|
69
69
|
"@react-aria/utils": "3.9.0",
|
|
@@ -195,10 +195,8 @@
|
|
|
195
195
|
"yarn tsc"
|
|
196
196
|
]
|
|
197
197
|
},
|
|
198
|
-
"packageManager": "yarn@4.4.0",
|
|
199
198
|
"volta": {
|
|
200
199
|
"node": "20.9.0",
|
|
201
200
|
"yarn": "4.4.0"
|
|
202
|
-
}
|
|
203
|
-
"stableVersion": "0.66.7-dev.5"
|
|
201
|
+
}
|
|
204
202
|
}
|
|
@@ -2,7 +2,7 @@ import { useCallback, useMemo } from "react";
|
|
|
2
2
|
import { Button } from "react-bootstrap";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import { range } from "lodash";
|
|
5
|
-
import {
|
|
5
|
+
import { ReactComponent as SelectArrow } from "../../../assets/iframe/selectArrow.svg";
|
|
6
6
|
import { CalendarSelect } from "../CalendarSelect";
|
|
7
7
|
import { CalendarProps } from "../../Calendar";
|
|
8
8
|
|
|
@@ -26,21 +26,15 @@ export const CalendarButtons = ({
|
|
|
26
26
|
}: CalendarButtonsProps) => {
|
|
27
27
|
const { t } = useTranslation("Design");
|
|
28
28
|
|
|
29
|
-
const
|
|
30
|
-
(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (nextDateTime <= initialDate) {
|
|
35
|
-
setCurrentDate(initialDate);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
29
|
+
const onSelectNextMonth = useCallback(() => {
|
|
30
|
+
setCurrentDate((prevDate) => prevDate.plus({ months: 1 }));
|
|
31
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
+
}, []);
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
}
|
|
34
|
+
const onSelectPreviousMonth = useCallback(() => {
|
|
35
|
+
setCurrentDate((prevDate) => prevDate.minus({ month: 1 }));
|
|
41
36
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
-
|
|
43
|
-
);
|
|
37
|
+
}, []);
|
|
44
38
|
|
|
45
39
|
const yearOptions = useMemo(() => {
|
|
46
40
|
return range(initialDate.year, initialDate.year + 5, 1).map((year) => {
|
|
@@ -48,18 +42,10 @@ export const CalendarButtons = ({
|
|
|
48
42
|
});
|
|
49
43
|
}, [initialDate]);
|
|
50
44
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
label: DateTime.fromObject({ month: monthNumber }).toLocaleString({
|
|
57
|
-
month: "long",
|
|
58
|
-
}),
|
|
59
|
-
value: monthNumber,
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
}, [initialDate, currentDate]);
|
|
45
|
+
const canMoveBack = useMemo(
|
|
46
|
+
() => currentDate > initialDate,
|
|
47
|
+
[currentDate, initialDate],
|
|
48
|
+
);
|
|
63
49
|
|
|
64
50
|
const onSelectYear = (value: string) => {
|
|
65
51
|
const selectedYear = Number(value);
|
|
@@ -121,11 +107,22 @@ export const CalendarButtons = ({
|
|
|
121
107
|
<hr />
|
|
122
108
|
<div className="calendar-buttons">
|
|
123
109
|
<div className="buttons-wrapper">
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
110
|
+
<Button
|
|
111
|
+
className="calendar-button left-button"
|
|
112
|
+
onClick={onSelectPreviousMonth}
|
|
113
|
+
disabled={!canMoveBack}
|
|
114
|
+
variant="link"
|
|
115
|
+
>
|
|
116
|
+
<SelectArrow />
|
|
117
|
+
</Button>
|
|
118
|
+
<div className="month-title">{currentDate.toFormat("MMMM")}</div>
|
|
119
|
+
<Button
|
|
120
|
+
className="calendar-button"
|
|
121
|
+
onClick={onSelectNextMonth}
|
|
122
|
+
variant="link"
|
|
123
|
+
>
|
|
124
|
+
<SelectArrow />
|
|
125
|
+
</Button>
|
|
129
126
|
</div>
|
|
130
127
|
<CalendarSelect
|
|
131
128
|
options={yearOptions}
|
|
@@ -89,13 +89,6 @@ export function IntervalInput({
|
|
|
89
89
|
trigger("end");
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
const onChangeRecurrent = (checked: boolean) => {
|
|
93
|
-
setRecurrent(checked);
|
|
94
|
-
if (!checked) {
|
|
95
|
-
setValue("rrule", null);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
|
|
99
92
|
return (
|
|
100
93
|
<>
|
|
101
94
|
<Form.Row className="interval-container">
|
|
@@ -151,7 +144,7 @@ export function IntervalInput({
|
|
|
151
144
|
custom
|
|
152
145
|
checked={recurrent}
|
|
153
146
|
onChange={({ target: { checked } }) => {
|
|
154
|
-
|
|
147
|
+
setRecurrent(checked);
|
|
155
148
|
}}
|
|
156
149
|
disabled={disabled || Boolean(editedProductSet)}
|
|
157
150
|
/>
|
package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx
CHANGED
|
@@ -5,11 +5,9 @@ import { useId } from "@react-aria/utils";
|
|
|
5
5
|
import { Controller, useFormContext } from "react-hook-form";
|
|
6
6
|
import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
|
|
7
7
|
import { ProductSet } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
|
|
8
|
-
import { getTypeHeadItemsFromMenus } from "../../../../product-set/utils";
|
|
9
8
|
import { ConfirmModal } from "../../../../modals/confirmation/ConfirmModal";
|
|
10
9
|
import { EditEventFormValues } from "../EditEventForm/EditEventForm";
|
|
11
10
|
import { EditEventProductSet } from "./component/EditEventProductSet";
|
|
12
|
-
import { Typeahead } from "../../../../typeahead";
|
|
13
11
|
|
|
14
12
|
interface SelectEventProductSetProps extends HasPermissionProp {
|
|
15
13
|
productSets?: ProductSet[];
|
|
@@ -44,21 +42,6 @@ export const SelectEventProductSet = ({
|
|
|
44
42
|
const productSetId = watch("productSetId");
|
|
45
43
|
const editedProductSet = watch("editedProductSet");
|
|
46
44
|
|
|
47
|
-
const typeheadValues = getTypeHeadItemsFromMenus(
|
|
48
|
-
editedProductSet
|
|
49
|
-
? productSets.map((productSet) => {
|
|
50
|
-
if (productSet.id === editedProductSet.id) {
|
|
51
|
-
return editedProductSet;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return productSet;
|
|
55
|
-
})
|
|
56
|
-
: productSets,
|
|
57
|
-
);
|
|
58
|
-
const selectedProductSetTypeheadValue = productSetId
|
|
59
|
-
? typeheadValues?.find((typeheadValue) => typeheadValue.id === productSetId)
|
|
60
|
-
: undefined;
|
|
61
|
-
|
|
62
45
|
const onEditProductSet = useCallback(
|
|
63
46
|
() => {
|
|
64
47
|
setEditProductSetId(String(productSetId));
|
|
@@ -112,7 +95,6 @@ export const SelectEventProductSet = ({
|
|
|
112
95
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
113
96
|
const onSubmit = (value: EditEventFormValues["editedProductSet"]) => {
|
|
114
97
|
setShowEditProductSet(false);
|
|
115
|
-
setValue("productSetId", value.id);
|
|
116
98
|
setValue("editedProductSet", value);
|
|
117
99
|
};
|
|
118
100
|
|
|
@@ -128,29 +110,49 @@ export const SelectEventProductSet = ({
|
|
|
128
110
|
<Controller
|
|
129
111
|
control={control}
|
|
130
112
|
name="productSetId"
|
|
131
|
-
render={() => {
|
|
113
|
+
render={({ field }) => {
|
|
114
|
+
const fieldValue = String(field.value);
|
|
132
115
|
return (
|
|
133
116
|
<>
|
|
134
117
|
<div className="d-flex align-items-center flex-row w-100">
|
|
135
118
|
<ConfirmModal>
|
|
136
119
|
{(confirm) => {
|
|
137
120
|
return (
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
containerStyles={{ width: "100%" }}
|
|
142
|
-
onChangeValue={(typeheadValue) => {
|
|
121
|
+
<Form.Control
|
|
122
|
+
as="select"
|
|
123
|
+
onChange={(e) =>
|
|
143
124
|
onChangeProductSet(
|
|
144
|
-
Number(
|
|
125
|
+
Number(e.target.value),
|
|
145
126
|
confirm,
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
isInvalid={Boolean(errors.productSetId)}
|
|
130
|
+
value={fieldValue}
|
|
131
|
+
>
|
|
132
|
+
<option value="" hidden>
|
|
133
|
+
{t("Design:chooseProductSet")}
|
|
134
|
+
</option>
|
|
135
|
+
{productSets?.map((productSet) => {
|
|
136
|
+
const isCurrentEditedProductSet =
|
|
137
|
+
editedProductSet &&
|
|
138
|
+
editedProductSet?.id === productSet?.id;
|
|
139
|
+
return (
|
|
140
|
+
<option
|
|
141
|
+
key={productSet.id}
|
|
142
|
+
value={productSet.id}
|
|
143
|
+
>
|
|
144
|
+
{isCurrentEditedProductSet ||
|
|
145
|
+
productSet.isOverride
|
|
146
|
+
? `[${t("edited")}] ${
|
|
147
|
+
isCurrentEditedProductSet
|
|
148
|
+
? editedProductSet?.name
|
|
149
|
+
: productSet.name
|
|
150
|
+
}`
|
|
151
|
+
: productSet.name}
|
|
152
|
+
</option>
|
|
146
153
|
);
|
|
147
|
-
}}
|
|
148
|
-
|
|
149
|
-
placeholder={t("Design:choose")}
|
|
150
|
-
noOptionsMessage={t(
|
|
151
|
-
"Design:noAvailableProductSets",
|
|
152
|
-
)}
|
|
153
|
-
/>
|
|
154
|
+
})}
|
|
155
|
+
</Form.Control>
|
|
154
156
|
);
|
|
155
157
|
}}
|
|
156
158
|
</ConfirmModal>
|
|
@@ -17,7 +17,7 @@ export const HelpPopoverPrimaryVariant: Story<HelpPopoverProps> = (args) => (
|
|
|
17
17
|
<HelpPopover {...args} />
|
|
18
18
|
);
|
|
19
19
|
export const HelpPopoverOutlinedInfoVariant: Story<HelpPopoverProps> = (
|
|
20
|
-
args
|
|
20
|
+
args,
|
|
21
21
|
) => <HelpPopover {...args} />;
|
|
22
22
|
|
|
23
23
|
DefaultHelpPopover.args = {
|
|
@@ -260,9 +260,9 @@ export function Default() {
|
|
|
260
260
|
(point) =>
|
|
261
261
|
Boolean(
|
|
262
262
|
MENU_STEPS[0].pointProducts.find(
|
|
263
|
-
(pointProduct) => pointProduct.pointId === point.id
|
|
264
|
-
)
|
|
265
|
-
)
|
|
263
|
+
(pointProduct) => pointProduct.pointId === point.id,
|
|
264
|
+
),
|
|
265
|
+
),
|
|
266
266
|
)}
|
|
267
267
|
pointProducts={MENU_STEPS[0].pointProducts}
|
|
268
268
|
usedInIframe={usedInIframe}
|
package/src/layout/DropDown.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
2
|
|
|
3
3
|
interface Props {
|
|
4
4
|
children?: React.ReactNode | React.ReactNode[];
|
|
@@ -24,5 +24,4 @@ const DropDown = forwardRef((props: Props, ref: any) => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
DropDown.displayName = "DropDown";
|
|
27
|
-
|
|
28
27
|
export default DropDown;
|
|
@@ -20,9 +20,6 @@ export type ConfirmModalTypes =
|
|
|
20
20
|
export interface ConfirmModalProps {
|
|
21
21
|
type?: ConfirmModalTypes;
|
|
22
22
|
children?: (confirm: (action: ConfirmAction) => void) => ReactNode;
|
|
23
|
-
// confirm function memoize the callback function. It's an alternative function
|
|
24
|
-
confirmationHandler?: () => Promise<boolean | undefined>;
|
|
25
|
-
disabledButtons?: boolean;
|
|
26
23
|
title?: string;
|
|
27
24
|
content?: string | ReactNode;
|
|
28
25
|
onClose?: () => void;
|
|
@@ -40,9 +37,7 @@ export function ConfirmModal({
|
|
|
40
37
|
type = "default",
|
|
41
38
|
children,
|
|
42
39
|
onClose,
|
|
43
|
-
confirmationHandler,
|
|
44
40
|
title,
|
|
45
|
-
disabledButtons,
|
|
46
41
|
content,
|
|
47
42
|
hideButtons = false,
|
|
48
43
|
}: ConfirmModalProps) {
|
|
@@ -57,16 +52,10 @@ export function ConfirmModal({
|
|
|
57
52
|
setIsOpen(() => true);
|
|
58
53
|
};
|
|
59
54
|
|
|
60
|
-
const handleConfirmation =
|
|
55
|
+
const handleConfirmation = (e) => {
|
|
61
56
|
e.stopPropagation();
|
|
62
|
-
if (!actionRef.current
|
|
63
|
-
|
|
64
|
-
const res = await confirmationHandler();
|
|
65
|
-
if (res) {
|
|
66
|
-
setIsOpen(() => false);
|
|
67
|
-
}
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
57
|
+
if (!actionRef.current) return;
|
|
58
|
+
|
|
70
59
|
actionRef.current();
|
|
71
60
|
setIsOpen(() => false);
|
|
72
61
|
};
|
|
@@ -99,7 +88,6 @@ export function ConfirmModal({
|
|
|
99
88
|
<Button
|
|
100
89
|
variant="danger"
|
|
101
90
|
className="btn-sm rounded"
|
|
102
|
-
disabled={disabledButtons}
|
|
103
91
|
onClick={handleClose}
|
|
104
92
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
105
93
|
>
|
|
@@ -117,14 +105,12 @@ export function ConfirmModal({
|
|
|
117
105
|
variant="outline"
|
|
118
106
|
className="cancel-button"
|
|
119
107
|
onClick={handleClose}
|
|
120
|
-
disabled={disabledButtons}
|
|
121
108
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
122
109
|
>
|
|
123
110
|
{t("cancel")}
|
|
124
111
|
</Button>
|
|
125
112
|
<Button
|
|
126
113
|
variant="danger"
|
|
127
|
-
disabled={disabledButtons}
|
|
128
114
|
onClick={handleConfirmation}
|
|
129
115
|
data-id={CONFIRM_MODAL_ACTION_CONFIRM}
|
|
130
116
|
>
|
|
@@ -135,7 +121,6 @@ export function ConfirmModal({
|
|
|
135
121
|
<>
|
|
136
122
|
<Button
|
|
137
123
|
variant="danger"
|
|
138
|
-
disabled={disabledButtons}
|
|
139
124
|
onClick={handleClose}
|
|
140
125
|
data-id={CONFIRM_MODAL_ACTION_DECLINE}
|
|
141
126
|
>
|
|
@@ -143,7 +128,6 @@ export function ConfirmModal({
|
|
|
143
128
|
</Button>
|
|
144
129
|
<Button
|
|
145
130
|
variant="success"
|
|
146
|
-
disabled={disabledButtons}
|
|
147
131
|
onClick={handleConfirmation}
|
|
148
132
|
data-id={CONFIRM_MODAL_ACTION_CONFIRM}
|
|
149
133
|
>
|
|
@@ -9,8 +9,7 @@ export default {
|
|
|
9
9
|
|
|
10
10
|
export const Default: Story<ProductSetCardProps> = (args) => (
|
|
11
11
|
<ProductSetCard {...args} />
|
|
12
|
-
)
|
|
13
|
-
|
|
12
|
+
);
|
|
14
13
|
|
|
15
14
|
Default.args = {
|
|
16
15
|
href: "#",
|
|
@@ -18,4 +17,3 @@ Default.args = {
|
|
|
18
17
|
rrule: "FREQ=WEEKLY;BYDAY=WE",
|
|
19
18
|
hasPermission: true,
|
|
20
19
|
};
|
|
21
|
-
|
|
@@ -9,20 +9,15 @@ import RouteService from "@licklist/plugins/dist/services/Route/RouteService";
|
|
|
9
9
|
import { FaEllipsisH, FaEye, FaTrashAlt } from "react-icons/fa";
|
|
10
10
|
import { ConfirmModal } from "../../modals";
|
|
11
11
|
import { MenuButton } from "../../table/MenuButton";
|
|
12
|
-
import { ProductSetNameControl } from "../form/ProductSetNameControl";
|
|
13
12
|
|
|
14
13
|
export interface ProductSetCardProps extends HasPermissionProp {
|
|
15
14
|
name: string;
|
|
16
15
|
rrule?: string;
|
|
17
16
|
href: string;
|
|
18
|
-
|
|
19
|
-
onChangeDuplicateProductSetName: (value: string) => void;
|
|
20
|
-
onCopy: () => Promise<boolean | undefined>;
|
|
17
|
+
onCopy: () => void;
|
|
21
18
|
onRemove: () => void;
|
|
22
|
-
isLoading?: boolean;
|
|
23
19
|
className?: string;
|
|
24
20
|
override?: number;
|
|
25
|
-
duplicateProductSetError?: string;
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
export function ProductSetCard({
|
|
@@ -31,10 +26,6 @@ export function ProductSetCard({
|
|
|
31
26
|
href,
|
|
32
27
|
onCopy,
|
|
33
28
|
onRemove,
|
|
34
|
-
onChangeDuplicateProductSetName,
|
|
35
|
-
duplicateProductSetName,
|
|
36
|
-
duplicateProductSetError,
|
|
37
|
-
isLoading,
|
|
38
29
|
className = "",
|
|
39
30
|
hasPermission = true,
|
|
40
31
|
override = 0,
|
|
@@ -44,23 +35,19 @@ export function ProductSetCard({
|
|
|
44
35
|
const productSetCardClasses = `product-set-card ${className}`;
|
|
45
36
|
const [isOverlayVisibile, setIsOverlayVisible] = useState(false);
|
|
46
37
|
|
|
47
|
-
const onCardClick = () => {
|
|
48
|
-
RouteService.redirectTo(href);
|
|
49
|
-
};
|
|
50
38
|
return (
|
|
51
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
52
39
|
<div
|
|
53
40
|
role="button"
|
|
54
41
|
tabIndex={0}
|
|
55
42
|
className="border-0 product-set-card-wrapper w-100 pb-0"
|
|
56
|
-
onClick={
|
|
43
|
+
onClick={() => RouteService.redirectTo(href)}
|
|
44
|
+
onKeyUp={() => RouteService.redirectTo(href)}
|
|
57
45
|
>
|
|
58
46
|
<div className={productSetCardClasses}>
|
|
59
47
|
<div className="product-set-card-link">
|
|
60
48
|
<div className="d-flex flex-column">
|
|
61
49
|
<div>
|
|
62
|
-
{name}
|
|
63
|
-
{rrule && `(${RRule.fromString(rrule).toText()})`}
|
|
50
|
+
{name} {rrule && `(${RRule.fromString(rrule).toText()})`}
|
|
64
51
|
</div>
|
|
65
52
|
{!!override && (
|
|
66
53
|
<div className="h6 bold ml-1">
|
|
@@ -92,33 +79,14 @@ export function ProductSetCard({
|
|
|
92
79
|
>
|
|
93
80
|
{hasPermission && (
|
|
94
81
|
<>
|
|
95
|
-
<ListGroup.Item
|
|
96
|
-
action
|
|
97
|
-
as="div"
|
|
98
|
-
role="button"
|
|
99
|
-
tabIndex={0}
|
|
100
|
-
onClick={(e) => e.stopPropagation()}
|
|
101
|
-
>
|
|
82
|
+
<ListGroup.Item action as="div">
|
|
102
83
|
{Boolean(onCopy) && (
|
|
103
|
-
<ConfirmModal
|
|
104
|
-
// confirm function memoize the callback function and it leads to bugs
|
|
105
|
-
confirmationHandler={onCopy}
|
|
106
|
-
disabledButtons={isLoading}
|
|
107
|
-
content={
|
|
108
|
-
<ProductSetNameControl
|
|
109
|
-
value={duplicateProductSetName}
|
|
110
|
-
onChange={onChangeDuplicateProductSetName}
|
|
111
|
-
error={duplicateProductSetError}
|
|
112
|
-
/>
|
|
113
|
-
}
|
|
114
|
-
>
|
|
84
|
+
<ConfirmModal>
|
|
115
85
|
{(confirm) => (
|
|
116
86
|
<MenuButton
|
|
117
87
|
onClick={() => {
|
|
118
88
|
setIsOverlayVisible(false);
|
|
119
|
-
|
|
120
|
-
// confirm function memoize the callback function and it leads to bugs
|
|
121
|
-
confirm(() => {});
|
|
89
|
+
confirm(onCopy);
|
|
122
90
|
}}
|
|
123
91
|
name={t("duplicate")}
|
|
124
92
|
className="product-set-card-menu-item-text"
|
|
@@ -127,14 +95,7 @@ export function ProductSetCard({
|
|
|
127
95
|
</ConfirmModal>
|
|
128
96
|
)}
|
|
129
97
|
</ListGroup.Item>
|
|
130
|
-
<ListGroup.Item
|
|
131
|
-
action
|
|
132
|
-
className="text-danger"
|
|
133
|
-
as="div"
|
|
134
|
-
role="button"
|
|
135
|
-
tabIndex={0}
|
|
136
|
-
onClick={(e) => e.stopPropagation()}
|
|
137
|
-
>
|
|
98
|
+
<ListGroup.Item action className="text-danger" as="div">
|
|
138
99
|
{Boolean(onRemove) && (
|
|
139
100
|
<ConfirmModal>
|
|
140
101
|
{(confirm) => (
|
|
@@ -247,8 +247,7 @@ export const DateInput = ({
|
|
|
247
247
|
menuRecurrence={menuRecurrence}
|
|
248
248
|
onEdit={() => handleOnEdit(menuRecurrence, index)}
|
|
249
249
|
errorMessage={
|
|
250
|
-
errors?.menuRecurrences?.[`${index}`]?.availableTimes
|
|
251
|
-
?.message || errors?.menuRecurrences?.[`${index}`]?.message
|
|
250
|
+
errors?.menuRecurrences?.[`${index}`]?.availableTimes?.message
|
|
252
251
|
}
|
|
253
252
|
/>
|
|
254
253
|
))}
|
|
@@ -23,7 +23,7 @@ interface ProductSetRecurrences {
|
|
|
23
23
|
|
|
24
24
|
export const Default: Story<ProductSetRecurrences> = (args) => {
|
|
25
25
|
const [items, setItems] = useState(
|
|
26
|
-
args.menuRecurrences?.sort((a, b) => a.sort - b.sort) ?? []
|
|
26
|
+
args.menuRecurrences?.sort((a, b) => a.sort - b.sort) ?? [],
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
const onDragEnd = ({ over, active }) => {
|
|
@@ -31,7 +31,7 @@ export const Default: Story<ProductSetRecurrences> = (args) => {
|
|
|
31
31
|
|
|
32
32
|
setItems((items) => {
|
|
33
33
|
const prevIndex = items.findIndex(
|
|
34
|
-
(item) => String(item.id) === active.id
|
|
34
|
+
(item) => String(item.id) === active.id,
|
|
35
35
|
);
|
|
36
36
|
const nextIndex = items.findIndex((item) => String(item.id) === over.id);
|
|
37
37
|
|