@licklist/design 0.69.7 → 0.69.9
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/ryft/utils/ryft-form.js +1 -1
- 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/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +56 -1
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +8 -0
- package/package.json +1 -1
- package/src/iframe/ryft/utils/ryft-form.ts +1 -1
- package/src/product-set/control/DateInput.tsx +2 -1
- package/src/product-set/form/ProductSetForm.tsx +9 -1
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +8 -0
- package/yarn.lock +11 -4
|
@@ -53,7 +53,7 @@ var injectComponentsInRyftForm = function(param) {
|
|
|
53
53
|
}
|
|
54
54
|
if (appleButton) {
|
|
55
55
|
appleButton.disabled = isDisableButton;
|
|
56
|
-
appleButton.style.opacity = isDisableButton ? '1' : '0.6';
|
|
56
|
+
appleButton.style.opacity = !isDisableButton ? '1' : '0.6';
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
if (isAppUsingInIframe) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/DateInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAOzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uEAAuE,CAAA;AAG5G,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAA;AAiBrF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAA;CAClD;AAED,UAAU,2BAA2B;IACnC,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;IACtB,4BAA4B,EAAE,OAAO,CAAA;IACrC,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,SAAS,mFAKnB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/DateInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAOzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uEAAuE,CAAA;AAG5G,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAA;AAiBrF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAA;CAClD;AAED,UAAU,2BAA2B;IACnC,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;IACtB,4BAA4B,EAAE,OAAO,CAAA;IACrC,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,SAAS,mFAKnB,2BAA2B,4CAuP7B,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAC5C,WAAW,EACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBxB,CAAA"}
|
|
@@ -400,13 +400,13 @@ var DateInput = function(param) {
|
|
|
400
400
|
className: "product-set-recurrences",
|
|
401
401
|
children: [
|
|
402
402
|
fields.map(function(menuRecurrence, index) {
|
|
403
|
-
var _errors_menuRecurrences__availableTimes, _errors_menuRecurrences_, _errors_menuRecurrences;
|
|
403
|
+
var _errors_menuRecurrences__availableTimes, _errors_menuRecurrences_, _errors_menuRecurrences, _errors_menuRecurrences_1, _errors_menuRecurrences1;
|
|
404
404
|
return /*#__PURE__*/ jsx(ProductSetRecurrenceOverridesControl, {
|
|
405
405
|
menuRecurrence: menuRecurrence,
|
|
406
406
|
onEdit: function() {
|
|
407
407
|
return handleOnEdit(menuRecurrence, index);
|
|
408
408
|
},
|
|
409
|
-
errorMessage: errors === null || errors === void 0 ? void 0 : (_errors_menuRecurrences = errors.menuRecurrences) === null || _errors_menuRecurrences === void 0 ? void 0 : (_errors_menuRecurrences_ = _errors_menuRecurrences["".concat(index)]) === null || _errors_menuRecurrences_ === void 0 ? void 0 : (_errors_menuRecurrences__availableTimes = _errors_menuRecurrences_.availableTimes) === null || _errors_menuRecurrences__availableTimes === void 0 ? void 0 : _errors_menuRecurrences__availableTimes.message
|
|
409
|
+
errorMessage: (errors === null || errors === void 0 ? void 0 : (_errors_menuRecurrences = errors.menuRecurrences) === null || _errors_menuRecurrences === void 0 ? void 0 : (_errors_menuRecurrences_ = _errors_menuRecurrences["".concat(index)]) === null || _errors_menuRecurrences_ === void 0 ? void 0 : (_errors_menuRecurrences__availableTimes = _errors_menuRecurrences_.availableTimes) === null || _errors_menuRecurrences__availableTimes === void 0 ? void 0 : _errors_menuRecurrences__availableTimes.message) || (errors === null || errors === void 0 ? void 0 : (_errors_menuRecurrences1 = errors.menuRecurrences) === null || _errors_menuRecurrences1 === void 0 ? void 0 : (_errors_menuRecurrences_1 = _errors_menuRecurrences1["".concat(index)]) === null || _errors_menuRecurrences_1 === void 0 ? void 0 : _errors_menuRecurrences_1.message)
|
|
410
410
|
}, menuRecurrence._id);
|
|
411
411
|
}),
|
|
412
412
|
fields.length < MAX_QUANTITY_RECURRENCE_DATE_IN_OVERRIDE && /*#__PURE__*/ jsxs("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSetForm.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductSetForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAA;AAIzF,OAAO,EAAE,WAAW,EAAE,MAAM,8DAA8D,CAAA;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAK3E,OAAO,EAAE,gCAAgC,EAAE,MAAM,oFAA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IACpC,mBAAmB,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC3D,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC3D,gBAAgB,CAAC,EAAE,UAAU,EAAE,CAAA;IAC/B,YAAY,CAAC,EAAE,WAAW,CAAA;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAA;IAC5B,4BAA4B,CAAC,EAAE,gCAAgC,CAAC,sBAAsB,CAAC,CAAA;IACvF,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;IACrB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,cAAc,CAAC,EAC7B,WAAW,EACX,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAsB,EACtB,YAAiB,EACjB,4BAA4B,EAC5B,KAAK,EACL,cAAc,EACd,SAAS,EACT,WAAW,EACX,oBAAoB,EACpB,QAAQ,EACR,GAAG,MAAM,EACV,EAAE,mBAAmB,2CAiKrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useEffect } from 'react';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
3
|
import { Form, Row, Col, Button } from 'react-bootstrap';
|
|
4
4
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
@@ -11,7 +11,16 @@ import { useDialogContext } from '../../modals/dialog/DialogContext.js';
|
|
|
11
11
|
import { ProductSetControl } from '../control/ProductSetControl.js';
|
|
12
12
|
import { ProductSetContextProvider, ProductSetLoadingContext } from './context.js';
|
|
13
13
|
import { getFilteredTemplates, checkAvailableTimesErrors } from '../utils/index.js';
|
|
14
|
+
import { ErrorModal } from '../../iframe/order-process/components/ErrorModal/ErrorModal.js';
|
|
14
15
|
|
|
16
|
+
function _array_like_to_array(arr, len) {
|
|
17
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
18
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
19
|
+
return arr2;
|
|
20
|
+
}
|
|
21
|
+
function _array_with_holes(arr) {
|
|
22
|
+
if (Array.isArray(arr)) return arr;
|
|
23
|
+
}
|
|
15
24
|
function _define_property(obj, key, value) {
|
|
16
25
|
if (key in obj) {
|
|
17
26
|
Object.defineProperty(obj, key, {
|
|
@@ -25,6 +34,33 @@ function _define_property(obj, key, value) {
|
|
|
25
34
|
}
|
|
26
35
|
return obj;
|
|
27
36
|
}
|
|
37
|
+
function _iterable_to_array_limit(arr, i) {
|
|
38
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
39
|
+
if (_i == null) return;
|
|
40
|
+
var _arr = [];
|
|
41
|
+
var _n = true;
|
|
42
|
+
var _d = false;
|
|
43
|
+
var _s, _e;
|
|
44
|
+
try {
|
|
45
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
46
|
+
_arr.push(_s.value);
|
|
47
|
+
if (i && _arr.length === i) break;
|
|
48
|
+
}
|
|
49
|
+
} catch (err) {
|
|
50
|
+
_d = true;
|
|
51
|
+
_e = err;
|
|
52
|
+
} finally{
|
|
53
|
+
try {
|
|
54
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
55
|
+
} finally{
|
|
56
|
+
if (_d) throw _e;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return _arr;
|
|
60
|
+
}
|
|
61
|
+
function _non_iterable_rest() {
|
|
62
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
63
|
+
}
|
|
28
64
|
function _object_spread(target) {
|
|
29
65
|
for(var i = 1; i < arguments.length; i++){
|
|
30
66
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -91,6 +127,17 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
91
127
|
}
|
|
92
128
|
return target;
|
|
93
129
|
}
|
|
130
|
+
function _sliced_to_array(arr, i) {
|
|
131
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
132
|
+
}
|
|
133
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
134
|
+
if (!o) return;
|
|
135
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
136
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
137
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
138
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
139
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
140
|
+
}
|
|
94
141
|
function ProductSetForm(_param) {
|
|
95
142
|
var companyName = _param.companyName, isLoading = _param.isLoading, defaultValues = _param.defaultValues, onSubmitAndRedirect = _param.onSubmitAndRedirect, onSubmitNoRedirect = _param.onSubmitNoRedirect, productGroupList = _param.productGroupList, serverErrors = _param.serverErrors, _param_providerHasMap = _param.providerHasMap, providerHasMap = _param_providerHasMap === void 0 ? false : _param_providerHasMap, _param_venueMapSets = _param.venueMapSets, venueMapSets = _param_venueMapSets === void 0 ? [] : _param_venueMapSets, providerHasBookingManagement = _param.providerHasBookingManagement, zones = _param.zones, isCreateAction = _param.isCreateAction, workHours = _param.workHours, isOverrides = _param.isOverrides, isCreateNewOverrides = _param.isCreateNewOverrides, timeZone = _param.timeZone, shared = _object_without_properties(_param, [
|
|
96
143
|
"companyName",
|
|
@@ -112,6 +159,7 @@ function ProductSetForm(_param) {
|
|
|
112
159
|
]);
|
|
113
160
|
var t = useTranslation('Design').t;
|
|
114
161
|
var _useDialogContext = useDialogContext(), isShownDialog = _useDialogContext.isShownDialog, onBeforeUnload = _useDialogContext.onBeforeUnload, onPopState = _useDialogContext.onPopState, onApproveDialog = _useDialogContext.onApproveDialog, onDeclineDialog = _useDialogContext.onDeclineDialog;
|
|
162
|
+
var _useState = _sliced_to_array(useState(''), 2), errorMessage = _useState[0], setErrorMessage = _useState[1];
|
|
115
163
|
var form = useForm({
|
|
116
164
|
defaultValues: defaultValues,
|
|
117
165
|
mode: 'onChange'
|
|
@@ -179,6 +227,13 @@ function ProductSetForm(_param) {
|
|
|
179
227
|
onApprove: onApproveDialog,
|
|
180
228
|
onDecline: onDeclineDialog
|
|
181
229
|
}),
|
|
230
|
+
/*#__PURE__*/ jsx(ErrorModal, {
|
|
231
|
+
message: errorMessage,
|
|
232
|
+
isOpen: !!errorMessage,
|
|
233
|
+
onClose: function() {
|
|
234
|
+
return setErrorMessage('');
|
|
235
|
+
}
|
|
236
|
+
}),
|
|
182
237
|
/*#__PURE__*/ jsx(FormProvider, _object_spread_props(_object_spread({}, form), {
|
|
183
238
|
children: /*#__PURE__*/ jsx(Form, {
|
|
184
239
|
onSubmit: form.handleSubmit(submitHandler(onSubmitAndRedirect)),
|
package/package.json
CHANGED
|
@@ -247,7 +247,8 @@ export const DateInput = ({
|
|
|
247
247
|
menuRecurrence={menuRecurrence}
|
|
248
248
|
onEdit={() => handleOnEdit(menuRecurrence, index)}
|
|
249
249
|
errorMessage={
|
|
250
|
-
errors?.menuRecurrences?.[`${index}`]?.availableTimes
|
|
250
|
+
errors?.menuRecurrences?.[`${index}`]?.availableTimes
|
|
251
|
+
?.message || errors?.menuRecurrences?.[`${index}`]?.message
|
|
251
252
|
}
|
|
252
253
|
/>
|
|
253
254
|
))}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect } from 'react'
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
2
|
import { FormValues } from '@licklist/plugins/dist/types/services/Form/hook-form-service'
|
|
3
3
|
import { Button, Form, Col, Row } from 'react-bootstrap'
|
|
4
4
|
import { FormProvider, useForm } from 'react-hook-form'
|
|
@@ -23,6 +23,7 @@ import { Step } from '../types'
|
|
|
23
23
|
import { ProductSetContextProvider, ProductSetLoadingContext } from './context'
|
|
24
24
|
import { SelectItem } from '../../types/generic/SelectItem'
|
|
25
25
|
import { checkAvailableTimesErrors, getFilteredTemplates } from '../utils'
|
|
26
|
+
import { ErrorModal } from '../../iframe/order-process/components/ErrorModal'
|
|
26
27
|
|
|
27
28
|
export interface WithIsLoading {
|
|
28
29
|
isLoading: boolean
|
|
@@ -85,6 +86,7 @@ export function ProductSetForm({
|
|
|
85
86
|
onApproveDialog,
|
|
86
87
|
onDeclineDialog,
|
|
87
88
|
} = useDialogContext()
|
|
89
|
+
const [errorMessage, setErrorMessage] = useState('')
|
|
88
90
|
|
|
89
91
|
const form = useForm<ProductSetFormValues>({
|
|
90
92
|
defaultValues,
|
|
@@ -166,6 +168,12 @@ export function ProductSetForm({
|
|
|
166
168
|
onDecline={onDeclineDialog}
|
|
167
169
|
/>
|
|
168
170
|
|
|
171
|
+
<ErrorModal
|
|
172
|
+
message={errorMessage}
|
|
173
|
+
isOpen={!!errorMessage}
|
|
174
|
+
onClose={() => setErrorMessage('')}
|
|
175
|
+
/>
|
|
176
|
+
|
|
169
177
|
<FormProvider {...form}>
|
|
170
178
|
<Form onSubmit={form.handleSubmit(submitHandler(onSubmitAndRedirect))}>
|
|
171
179
|
<ProductSetLoadingContext.Consumer>
|
package/yarn.lock
CHANGED
|
@@ -5667,11 +5667,11 @@ __metadata:
|
|
|
5667
5667
|
linkType: hard
|
|
5668
5668
|
|
|
5669
5669
|
"@types/node@npm:*":
|
|
5670
|
-
version: 22.7.
|
|
5671
|
-
resolution: "@types/node@npm:22.7.
|
|
5670
|
+
version: 22.7.7
|
|
5671
|
+
resolution: "@types/node@npm:22.7.7"
|
|
5672
5672
|
dependencies:
|
|
5673
5673
|
undici-types: "npm:~6.19.2"
|
|
5674
|
-
checksum: 10c0/
|
|
5674
|
+
checksum: 10c0/07268a1e990ad9d9b1865092881317ea679a46eb6706d83a8874eec75fdddae6cfd6452e4e68b651561183e2a8f8548276f3155744bc402c2545978c19b70d65
|
|
5675
5675
|
languageName: node
|
|
5676
5676
|
linkType: hard
|
|
5677
5677
|
|
|
@@ -14858,13 +14858,20 @@ __metadata:
|
|
|
14858
14858
|
languageName: node
|
|
14859
14859
|
linkType: hard
|
|
14860
14860
|
|
|
14861
|
-
"negotiator@npm:0.6.3
|
|
14861
|
+
"negotiator@npm:0.6.3":
|
|
14862
14862
|
version: 0.6.3
|
|
14863
14863
|
resolution: "negotiator@npm:0.6.3"
|
|
14864
14864
|
checksum: 10c0/3ec9fd413e7bf071c937ae60d572bc67155262068ed522cf4b3be5edbe6ddf67d095ec03a3a14ebf8fc8e95f8e1d61be4869db0dbb0de696f6b837358bd43fc2
|
|
14865
14865
|
languageName: node
|
|
14866
14866
|
linkType: hard
|
|
14867
14867
|
|
|
14868
|
+
"negotiator@npm:^0.6.3":
|
|
14869
|
+
version: 0.6.4
|
|
14870
|
+
resolution: "negotiator@npm:0.6.4"
|
|
14871
|
+
checksum: 10c0/3e677139c7fb7628a6f36335bf11a885a62c21d5390204590a1a214a5631fcbe5ea74ef6a610b60afe84b4d975cbe0566a23f20ee17c77c73e74b80032108dea
|
|
14872
|
+
languageName: node
|
|
14873
|
+
linkType: hard
|
|
14874
|
+
|
|
14868
14875
|
"neo-async@npm:^2.5.0, neo-async@npm:^2.6.1, neo-async@npm:^2.6.2":
|
|
14869
14876
|
version: 2.6.2
|
|
14870
14877
|
resolution: "neo-async@npm:2.6.2"
|