@licklist/design 0.66.0 → 0.66.1-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/date-time-button/DateTimeButton.js +1 -1
  2. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  3. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +1 -1
  4. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
  5. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
  6. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  7. package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
  8. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  9. package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
  10. package/dist/product-set/control/DateInput.js +1 -1
  11. package/dist/product-set/control/ProductSetControl.d.ts +3 -2
  12. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  13. package/dist/product-set/control/ProductSetControl.js +1 -1
  14. package/dist/product-set/form/ProductCategoriesControl.d.ts +3 -1
  15. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  16. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  17. package/dist/product-set/form/ProductSetForm.d.ts +6 -2
  18. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  19. package/dist/product-set/form/ProductSetForm.js +1 -1
  20. package/dist/product-set/form/ProductsControl.d.ts +3 -1
  21. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  22. package/dist/product-set/form/ProductsControl.js +1 -1
  23. package/dist/product-set/form/StepsControl.d.ts +3 -1
  24. package/dist/product-set/form/StepsControl.d.ts.map +1 -1
  25. package/dist/product-set/form/StepsControl.js +1 -1
  26. package/dist/product-set/product/ProductControl.d.ts +1 -0
  27. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  28. package/dist/product-set/product/ProductControl.js +1 -1
  29. package/dist/product-set/step/StepControl.d.ts +2 -1
  30. package/dist/product-set/step/StepControl.d.ts.map +1 -1
  31. package/dist/product-set/step/StepControl.js +1 -1
  32. package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
  33. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
  34. package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.d.ts.map +1 -1
  35. package/dist/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.js +1 -1
  36. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +3 -1
  37. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  38. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  39. package/dist/recurring-date-picker-input/utils.d.ts +5 -0
  40. package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
  41. package/dist/recurring-date-picker-input/utils.js +1 -1
  42. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts +1 -1
  43. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +1 -1
  44. package/dist/report/ReportRunnerModal/ReportRunnerModal.js +1 -1
  45. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  46. package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
  47. package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
  48. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
  49. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  50. package/dist/sortable-tree/SortableTreeItem.js +1 -1
  51. package/dist/styles/date-time-button/DateTimeButton.scss +1 -0
  52. package/dist/styles/iframe-page/Page.scss +1 -10
  53. package/dist/styles/sales/BookingResults.scss +1 -1
  54. package/dist/styles/zones/ZoneForm.scss +2 -1
  55. package/dist/zone/form/ZoneForm.d.ts +2 -2
  56. package/dist/zone/form/ZoneForm.d.ts.map +1 -1
  57. package/dist/zone/form/ZoneForm.js +1 -1
  58. package/dist/zone/form/components/ZoneControl.d.ts +2 -2
  59. package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
  60. package/dist/zone/form/components/ZoneControl.js +1 -1
  61. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
  62. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
  63. package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
  64. package/dist/zone/form/utils/dates.d.ts.map +1 -1
  65. package/package.json +3 -5
  66. package/src/date-time-button/DateTimeButton.stories.tsx +2 -1
  67. package/src/date-time-button/DateTimeButton.tsx +7 -5
  68. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +14 -9
  69. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +2 -0
  70. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
  71. package/src/product-set/control/DateAndRecurrenceInput.tsx +3 -4
  72. package/src/product-set/control/DateInput.tsx +2 -2
  73. package/src/product-set/control/ProductSetControl.tsx +17 -5
  74. package/src/product-set/form/ProductCategoriesControl.tsx +15 -4
  75. package/src/product-set/form/ProductSetForm.tsx +13 -2
  76. package/src/product-set/form/ProductsControl.tsx +93 -77
  77. package/src/product-set/form/StepsControl.tsx +15 -7
  78. package/src/product-set/product/ProductControl.tsx +8 -5
  79. package/src/product-set/step/StepControl.tsx +4 -3
  80. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +4 -18
  81. package/src/recurring-date-picker-input/RecurrenceIntervalAndFrequencyInput.tsx +50 -21
  82. package/src/recurring-date-picker-input/RecurringDatePickerInput.stories.tsx +13 -7
  83. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +12 -1
  84. package/src/recurring-date-picker-input/utils.ts +90 -1
  85. package/src/report/ReportRunnerModal/ReportRunnerModal.stories.tsx +307 -0
  86. package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +24 -14
  87. package/src/sales/booking/results/components/ResultCard.tsx +0 -3
  88. package/src/setting/admin/AdminSettingForm.tsx +2 -2
  89. package/src/sortable-tree/SortableTreeItem.tsx +0 -3
  90. package/src/static/switch/BooleanSwitch.tsx +1 -1
  91. package/src/styles/date-time-button/DateTimeButton.scss +1 -0
  92. package/src/styles/iframe-page/Page.scss +1 -10
  93. package/src/styles/sales/BookingResults.scss +1 -1
  94. package/src/styles/zones/ZoneForm.scss +2 -1
  95. package/src/zone/form/ZoneForm.tsx +3 -2
  96. package/src/zone/form/components/ZoneControl.tsx +3 -3
  97. package/src/zone/form/components/ZoneRecurrencesControl.tsx +7 -5
  98. package/src/zone/form/utils/dates.ts +9 -10
@@ -23,7 +23,7 @@ interface ReportField {
23
23
  title: string;
24
24
  }
25
25
 
26
- type ReportRunnerModalProps = {
26
+ export type ReportRunnerModalProps = {
27
27
  reportId: Report["id"] | null;
28
28
  show: boolean;
29
29
  useShowReportFields: (
@@ -136,28 +136,38 @@ export const ReportRunnerModal = ({
136
136
  </Button>
137
137
 
138
138
  <form noValidate>
139
- <div className="period-by">
140
- {PERIOD_BY_TYPES.map((type) => (
141
- <div key={type}>
142
- <Form.Group>
139
+ <div
140
+ className={`pl-1 ${
141
+ errors.periodBy?.message && "border-danger border rounded"
142
+ }`}
143
+ >
144
+ <div className="period-by">
145
+ {PERIOD_BY_TYPES.map((type) => (
146
+ <div key={type}>
143
147
  <Form.Check
144
148
  inline
145
- isInvalid={!!errors.periodBy}
146
149
  label={t(labelByPeriodType[type])}
147
150
  type="radio"
148
151
  id={type}
152
+ required
149
153
  value={type}
150
- {...register("periodBy")}
154
+ {...register("periodBy", {
155
+ required: `${t("Validation:fieldRequired", {
156
+ attribute: t("Design:period"),
157
+ })}`,
158
+ })}
151
159
  />
152
- <Form.Control.Feedback type="invalid">
153
- {errors.periodBy?.message}
154
- </Form.Control.Feedback>
155
- </Form.Group>
160
+ </div>
161
+ ))}
162
+ </div>
163
+ {errors.periodBy?.message && (
164
+ <div className="iframe-event__message-error justify-content-start mb-1">
165
+ {errors.periodBy?.message}
156
166
  </div>
157
- ))}
167
+ )}
158
168
  </div>
159
169
 
160
- <div className="controls">
170
+ <div className="controls mt-4">
161
171
  <Form.Group controlId="from-input">
162
172
  <Form.Label>{t("Design:from")}</Form.Label>
163
173
  <Form.Control
@@ -168,7 +178,7 @@ export const ReportRunnerModal = ({
168
178
  required: {
169
179
  value: true,
170
180
  message: `${t("Validation:fieldRequired", {
171
- attribute: t("Design:to"),
181
+ attribute: t("Design:from"),
172
182
  })}`,
173
183
  },
174
184
  })}
@@ -12,7 +12,6 @@ import { TIME_FORMAT } from "@licklist/core/dist/Config";
12
12
  import * as Config from "@licklist/core/dist/Config";
13
13
  import { formatDateStringForEvent } from "@licklist/plugins/dist/utils/formatDate";
14
14
  import { getOrderSourceTitle } from "@licklist/plugins/dist/utils/sourceTitle";
15
-
16
15
  import Icon from "../../../../static/Icon";
17
16
 
18
17
  export type ResultCardProps = {
@@ -22,8 +21,6 @@ export type ResultCardProps = {
22
21
  onCardClick?: (id: number) => void;
23
22
  };
24
23
 
25
- // @TODO integrate when API will be available
26
- // activity and staff keys
27
24
  export const ResultCard = ({
28
25
  order,
29
26
  className,
@@ -11,7 +11,7 @@ import Row from "react-bootstrap/Row";
11
11
  import Col from "react-bootstrap/Col";
12
12
  import { Link } from "react-router-dom";
13
13
  import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
14
- import { ProviderType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
14
+ import { ProvidableType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
15
15
  import Icon from "../../static/Icon";
16
16
  import { PaymentFeeForm, PaymentFeeFormFieldValues } from "./PaymentFeeForm";
17
17
  import { Currency } from "../../types/currency";
@@ -33,7 +33,7 @@ export interface AdminSettingFormProps extends HasPermissionProp {
33
33
  providerMetadata: {
34
34
  country?: string;
35
35
  providableId?: number;
36
- providerType?: ProviderType;
36
+ providerType?: ProvidableType;
37
37
  };
38
38
  }
39
39
 
@@ -53,7 +53,6 @@ export interface SortableTreeItemProps {
53
53
  };
54
54
  setIsExpanded?: () => void;
55
55
  isOverride?: boolean;
56
- isProduct?: boolean;
57
56
  }
58
57
 
59
58
  export function SortableTreeItem({
@@ -81,7 +80,6 @@ export function SortableTreeItem({
81
80
  secondaryBadge,
82
81
  setIsExpanded,
83
82
  isOverride,
84
- isProduct = false,
85
83
  }: SortableTreeItemProps) {
86
84
  const [expanded, setExpanded] = useState(isExpanded);
87
85
  const [isModalVisible, setIsModalVisible] = useState(isNewAdded);
@@ -152,7 +150,6 @@ export function SortableTreeItem({
152
150
  };
153
151
 
154
152
  const onEdit = (e) => {
155
- if (isOverride && !isProduct) return;
156
153
  e.stopPropagation();
157
154
  if (edit && !isModalVisible) edit();
158
155
  setIsModalVisible(true);
@@ -23,7 +23,7 @@ export function BooleanSwitch({
23
23
  const { t } = useTranslation("Design");
24
24
 
25
25
  const options: SelectItem[] = [
26
- { id: 1, value: firstValueTitle ?? t("yes") },
26
+ { id: 1, value: firstValueTitle ?? t("yes") },
27
27
  { id: 0, value: secondValueTitle ?? t("no") },
28
28
  ];
29
29
 
@@ -81,6 +81,7 @@
81
81
  min-width: 5.3rem;
82
82
  max-width: 5.3rem;
83
83
  min-height: 2.75rem;
84
+ border: 2px solid $snippet-calendar-disabled-button-border-color;
84
85
  }
85
86
 
86
87
  &.calendar-view {
@@ -43,8 +43,6 @@
43
43
  }
44
44
 
45
45
  .page-body {
46
- min-height: unset;
47
-
48
46
  .left-block {
49
47
  min-height: fit-content;
50
48
 
@@ -78,17 +76,10 @@
78
76
  }
79
77
 
80
78
  &.iframe {
81
- height: unset;
82
-
83
79
  .page-body {
84
- height: unset;
85
- max-height: unset;
86
-
87
80
  .left-block {
88
81
  .left-block-container {
89
- height: unset;
90
- max-height: unset;
91
- overflow: unset;
82
+ overflow: auto;
92
83
  }
93
84
  }
94
85
  }
@@ -5,7 +5,7 @@
5
5
  flex-wrap: wrap;
6
6
 
7
7
  .result-card {
8
- height: 14.25rem;
8
+ height: 14rem;
9
9
  border: 1px solid $gray-400;
10
10
  max-width: calc(50% - 0.75rem);
11
11
  flex: 0 0 calc(50% - 0.75rem);
@@ -1,4 +1,5 @@
1
1
  .zone-available-times {
2
+ overscroll-behavior: contain;
2
3
  display: flex;
3
4
  flex-wrap: wrap;
4
5
  gap: 1.5rem;
@@ -7,4 +8,4 @@
7
8
  justify-content: start;
8
9
  width: 95%;
9
10
  overflow: scroll;
10
- }
11
+ }
@@ -13,7 +13,7 @@ export type ZoneFormProps = {
13
13
  onSubmit: (values: Partial<Zone>) => void;
14
14
  serverErrors?: ServerError;
15
15
  isLoading?: boolean;
16
- workHours?: WorkHour[];
16
+ workHours: WorkHour[] | undefined;
17
17
  };
18
18
 
19
19
  export type ZoneFormValues = Partial<Zone> & {
@@ -25,6 +25,7 @@ export const ZoneForm = ({
25
25
  onSubmit,
26
26
  serverErrors,
27
27
  isLoading = false,
28
+ workHours,
28
29
  }: ZoneFormProps) => {
29
30
  const { t } = useTranslation("Design");
30
31
  const form = useForm<ZoneFormValues>({
@@ -54,7 +55,7 @@ export const ZoneForm = ({
54
55
  return (
55
56
  <FormProvider {...form}>
56
57
  <Form onSubmit={handleSubmit(onFormSubmit)}>
57
- <ZoneControl isLoading={isLoading} />
58
+ <ZoneControl isLoading={isLoading} workHours={workHours} />
58
59
  <Row>
59
60
  <Col md={6} sm={12} />
60
61
  <Col
@@ -11,15 +11,15 @@ import { GameDurationControl } from "./GameDurationControl";
11
11
 
12
12
  export type ZoneControlProps = {
13
13
  isLoading: boolean;
14
- workHours?: WorkHour[];
14
+ workHours: WorkHour[] | undefined;
15
15
  };
16
16
 
17
- export const ZoneControl = ({ isLoading }: ZoneControlProps) => {
17
+ export const ZoneControl = ({ isLoading, workHours }: ZoneControlProps) => {
18
18
  return (
19
19
  <Row>
20
20
  <Col md={6} sm={12} className="pr-5">
21
21
  <NameControl isLoading={isLoading} />
22
- <ZoneRecurrencesControl />
22
+ <ZoneRecurrencesControl workHours={workHours} />
23
23
  <hr />
24
24
  <Row>
25
25
  <Col md={6} sm={6}>
@@ -25,12 +25,13 @@ export interface DateAndRecurrenceInputValues {
25
25
  zoneRecurrences?: Partial<ZoneRecurrence>[];
26
26
  }
27
27
 
28
- export type ZoneRecurrenceControlProps = {
29
- workHours?: WorkHour[];
30
- isLoading?: boolean;
28
+ type ZoneRecurrenceControlProps = {
29
+ workHours: WorkHour[] | undefined;
31
30
  };
32
31
 
33
- export const ZoneRecurrencesControl = () => {
32
+ export const ZoneRecurrencesControl = ({
33
+ workHours,
34
+ }: ZoneRecurrenceControlProps) => {
34
35
  const {
35
36
  control,
36
37
  register,
@@ -69,7 +70,7 @@ export const ZoneRecurrencesControl = () => {
69
70
  clearEditState();
70
71
  });
71
72
 
72
- const popoverId = useId()!;
73
+ const popoverId = useId();
73
74
 
74
75
  const { t } = useTranslation(["Design", "Validation"]);
75
76
 
@@ -166,6 +167,7 @@ export const ZoneRecurrencesControl = () => {
166
167
  onChange={handleRecurringDateChange}
167
168
  onDelete={handleDelete}
168
169
  setInitialStartDateAfterSelect
170
+ workHours={workHours}
169
171
  />
170
172
  </Popover.Content>
171
173
  </Popover>
@@ -53,18 +53,17 @@ export const getCheckboxesByWorkHours = (workHours?: WorkHour[]) => {
53
53
  if (!workHours || !workHours.length)
54
54
  return getTimeCheckboxRanges(DEFAULT_START_DAY_TIME, DEFAULT_END_DAY_TIME);
55
55
 
56
- const providerWorkHoursByWeek = workHours.reduce(
57
- (workHoursNextArray: { start: string; end: string }[], currentWorkHour) => {
58
- const { start, end } = currentWorkHour;
56
+ const providerWorkHoursByWeek = workHours.reduce<
57
+ { start: string; end: string }[]
58
+ >((workHoursNextArray, currentWorkHour) => {
59
+ const { start, end } = currentWorkHour;
59
60
 
60
- if (start && end) {
61
- return [...workHoursNextArray, { start, end }];
62
- }
61
+ if (start && end) {
62
+ return [...workHoursNextArray, { start, end }];
63
+ }
63
64
 
64
- return workHoursNextArray;
65
- },
66
- []
67
- );
65
+ return workHoursNextArray;
66
+ }, []);
68
67
 
69
68
  // If venue has filled only 1 work day from wee
70
69
  // For another days we use default 00:00 and 23:59