@licklist/design 0.67.3-dev.1 → 0.67.3-dev.2
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/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +0 -2
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +1 -2
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +25 -25
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +1 -2
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -2
- package/dist/index.js +1 -0
- package/dist/modals/confirmation/ConfirmModal.d.ts +3 -1
- package/dist/modals/confirmation/ConfirmModal.d.ts.map +1 -1
- package/dist/modals/confirmation/ConfirmModal.js +172 -8
- package/dist/product-set/card/ProductSetCard.d.ts +6 -2
- package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
- package/dist/product-set/card/ProductSetCard.js +30 -11
- package/dist/product-set/control/ProductSetControl.d.ts +1 -3
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +2 -16
- package/dist/product-set/form/ProductSetNameControl.d.ts +6 -0
- package/dist/product-set/form/ProductSetNameControl.d.ts.map +1 -0
- package/dist/product-set/form/ProductSetNameControl.js +35 -0
- package/dist/product-set/form/index.d.ts +1 -0
- package/dist/product-set/form/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.d.ts +7 -0
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/product-set/utils/index.js +10 -1
- package/dist/typeahead/Typeahead.d.ts +5 -1
- package/dist/typeahead/Typeahead.d.ts.map +1 -1
- package/dist/typeahead/Typeahead.js +9 -2
- package/package.json +2 -2
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +0 -2
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +32 -37
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +0 -3
- package/src/modals/confirmation/ConfirmModal.tsx +19 -3
- package/src/product-set/card/ProductSetCard.tsx +47 -8
- package/src/product-set/control/ProductSetControl.tsx +0 -17
- package/src/product-set/form/ProductSetNameControl.tsx +27 -0
- package/src/product-set/form/index.ts +1 -0
- package/src/product-set/utils/index.ts +11 -0
- package/src/typeahead/Typeahead.tsx +15 -1
- package/yarn.lock +103 -110
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditEventForm.d.ts","sourceRoot":"","sources":["../../../../../src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,EACN,MAAM,sDAAsD,CAAC;AAM9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAGvF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAI5E,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAS7D,OAAO,EAAiB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAIzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAGnF,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACvB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;CACzC;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClD,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,WAAW,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACvD,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAOD,eAAO,MAAM,aAAa,+LAavB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"EditEventForm.d.ts","sourceRoot":"","sources":["../../../../../src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,EACN,MAAM,sDAAsD,CAAC;AAM9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAGvF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AA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K,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACvD,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAOD,eAAO,MAAM,aAAa,+LAavB,kBAAkB,4CAuVpB,CAAC"}
|
|
@@ -160,7 +160,6 @@ var EditEventForm = function(param) {
|
|
|
160
160
|
var visible = watch("visible");
|
|
161
161
|
var editedProductSet = watch("editedProductSet");
|
|
162
162
|
var productSetId = watch("productSetId");
|
|
163
|
-
var occurrenceStartAtDate = watch("start");
|
|
164
163
|
var _useMultipleImages = useMultipleImages(initialImages), images = _useMultipleImages.images, handleImageRemove = _useMultipleImages.handleImageRemove, handleImageUploading = _useMultipleImages.handleImageUploading, isImagesLoading = _useMultipleImages.isImagesLoading, isCoverImagesLoading = _useMultipleImages.isCoverImagesLoading;
|
|
165
164
|
var onErrorSubmit = function(submitErrors) {
|
|
166
165
|
scrollToError(getFirstErrorKey(submitErrors));
|
|
@@ -468,7 +467,6 @@ var EditEventForm = function(param) {
|
|
|
468
467
|
setEditProductSetId: setEditProductSetId,
|
|
469
468
|
setShowEditProductSet: setShowEditProductSet,
|
|
470
469
|
showEditProductSet: showEditProductSet,
|
|
471
|
-
occurrenceStartAtDate: occurrenceStartAtDate,
|
|
472
470
|
timeZone: timeZone
|
|
473
471
|
}),
|
|
474
472
|
hasPermission && !showEditProductSet && /*#__PURE__*/ jsx(Button, {
|
package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts
CHANGED
|
@@ -7,9 +7,8 @@ interface SelectEventProductSetProps extends HasPermissionProp {
|
|
|
7
7
|
setShowEditProductSet: (value: boolean) => void;
|
|
8
8
|
createProductSet: (props: EditEventFormValues) => void;
|
|
9
9
|
setEditProductSetId: (value: string) => void;
|
|
10
|
-
occurrenceStartAtDate: string;
|
|
11
10
|
timeZone: string;
|
|
12
11
|
}
|
|
13
|
-
export declare const SelectEventProductSet: ({ productSets, createProductSet, setEditProductSetId, showEditProductSet, setShowEditProductSet,
|
|
12
|
+
export declare const SelectEventProductSet: ({ productSets, createProductSet, setEditProductSetId, showEditProductSet, setShowEditProductSet, timeZone, }: SelectEventProductSetProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export {};
|
|
15
14
|
//# sourceMappingURL=SelectEventProductSet.d.ts.map
|
package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectEventProductSet.d.ts","sourceRoot":"","sources":["../../../../../src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectEventProductSet.d.ts","sourceRoot":"","sources":["../../../../../src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAC;AAGzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAIrE,UAAU,0BAA2B,SAAQ,iBAAiB;IAC5D,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,gBAAgB,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACvD,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,qBAAqB,iHAO/B,0BAA0B,4CA8L5B,CAAC"}
|
package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js
CHANGED
|
@@ -4,8 +4,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
4
4
|
import { Form, Button } from 'react-bootstrap';
|
|
5
5
|
import { useId } from '@react-aria/utils';
|
|
6
6
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
7
|
+
import { getTypeHeadItemsFromMenus } from '../../../../product-set/utils/index.js';
|
|
7
8
|
import { ConfirmModal } from '../../../../modals/confirmation/ConfirmModal.js';
|
|
8
9
|
import { EditEventProductSet } from './component/EditEventProductSet.js';
|
|
10
|
+
import { Typeahead } from '../../../../typeahead/Typeahead.js';
|
|
9
11
|
|
|
10
12
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
11
13
|
try {
|
|
@@ -132,7 +134,7 @@ function _ts_generator(thisArg, body) {
|
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
var SelectEventProductSet = function(param) {
|
|
135
|
-
var productSets = param.productSets, createProductSet = param.createProductSet, setEditProductSetId = param.setEditProductSetId, showEditProductSet = param.showEditProductSet, setShowEditProductSet = param.setShowEditProductSet,
|
|
137
|
+
var productSets = param.productSets, createProductSet = param.createProductSet, setEditProductSetId = param.setEditProductSetId, showEditProductSet = param.showEditProductSet, setShowEditProductSet = param.setShowEditProductSet, timeZone = param.timeZone;
|
|
136
138
|
var _productSets_find;
|
|
137
139
|
var t = useTranslation([
|
|
138
140
|
"Design"
|
|
@@ -142,6 +144,15 @@ var SelectEventProductSet = function(param) {
|
|
|
142
144
|
var productSetsId = useId();
|
|
143
145
|
var productSetId = watch("productSetId");
|
|
144
146
|
var editedProductSet = watch("editedProductSet");
|
|
147
|
+
var typeheadValues = getTypeHeadItemsFromMenus(editedProductSet ? productSets.map(function(productSet) {
|
|
148
|
+
if (productSet.id === editedProductSet.id) {
|
|
149
|
+
return editedProductSet;
|
|
150
|
+
}
|
|
151
|
+
return productSet;
|
|
152
|
+
}) : productSets);
|
|
153
|
+
var selectedProductSetTypeheadValue = productSetId ? typeheadValues === null || typeheadValues === void 0 ? void 0 : typeheadValues.find(function(typeheadValue) {
|
|
154
|
+
return typeheadValue.id === productSetId;
|
|
155
|
+
}) : undefined;
|
|
145
156
|
var onEditProductSet = useCallback(function() {
|
|
146
157
|
setEditProductSetId(String(productSetId));
|
|
147
158
|
setShowEditProductSet(true);
|
|
@@ -210,6 +221,7 @@ var SelectEventProductSet = function(param) {
|
|
|
210
221
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
211
222
|
var onSubmit = function(value) {
|
|
212
223
|
setShowEditProductSet(false);
|
|
224
|
+
setValue("productSetId", value.id);
|
|
213
225
|
setValue("editedProductSet", value);
|
|
214
226
|
};
|
|
215
227
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
@@ -226,10 +238,8 @@ var SelectEventProductSet = function(param) {
|
|
|
226
238
|
/*#__PURE__*/ jsx(Controller, {
|
|
227
239
|
control: control,
|
|
228
240
|
name: "productSetId",
|
|
229
|
-
render: function(
|
|
230
|
-
var field = param.field;
|
|
241
|
+
render: function() {
|
|
231
242
|
var _errors_productSetId;
|
|
232
|
-
var fieldValue = String(field.value);
|
|
233
243
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
234
244
|
children: [
|
|
235
245
|
/*#__PURE__*/ jsxs("div", {
|
|
@@ -237,27 +247,18 @@ var SelectEventProductSet = function(param) {
|
|
|
237
247
|
children: [
|
|
238
248
|
/*#__PURE__*/ jsx(ConfirmModal, {
|
|
239
249
|
children: function(confirm) {
|
|
240
|
-
return /*#__PURE__*/
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
250
|
+
return /*#__PURE__*/ jsx(Typeahead, {
|
|
251
|
+
name: "productSetId",
|
|
252
|
+
value: selectedProductSetTypeheadValue,
|
|
253
|
+
containerStyles: {
|
|
254
|
+
width: "100%"
|
|
255
|
+
},
|
|
256
|
+
onChangeValue: function(typeheadValue) {
|
|
257
|
+
onChangeProductSet(Number(typeheadValue.id), confirm);
|
|
244
258
|
},
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
/*#__PURE__*/ jsx("option", {
|
|
249
|
-
value: "",
|
|
250
|
-
hidden: true,
|
|
251
|
-
children: t("Design:chooseProductSet")
|
|
252
|
-
}),
|
|
253
|
-
productSets === null || productSets === void 0 ? void 0 : productSets.map(function(productSet) {
|
|
254
|
-
var isCurrentEditedProductSet = editedProductSet && (editedProductSet === null || editedProductSet === void 0 ? void 0 : editedProductSet.id) === (productSet === null || productSet === void 0 ? void 0 : productSet.id);
|
|
255
|
-
return /*#__PURE__*/ jsx("option", {
|
|
256
|
-
value: productSet.id,
|
|
257
|
-
children: isCurrentEditedProductSet || productSet.isOverride ? "[".concat(t("edited"), "] ").concat(isCurrentEditedProductSet ? editedProductSet === null || editedProductSet === void 0 ? void 0 : editedProductSet.name : productSet.name) : productSet.name
|
|
258
|
-
}, productSet.id);
|
|
259
|
-
})
|
|
260
|
-
]
|
|
259
|
+
options: typeheadValues,
|
|
260
|
+
placeholder: t("Design:choose"),
|
|
261
|
+
noOptionsMessage: t("Design:noAvailableProductSets")
|
|
261
262
|
});
|
|
262
263
|
}
|
|
263
264
|
}),
|
|
@@ -305,7 +306,6 @@ var SelectEventProductSet = function(param) {
|
|
|
305
306
|
}),
|
|
306
307
|
showEditProductSet && productSetId && /*#__PURE__*/ jsx(EditEventProductSet, {
|
|
307
308
|
onSubmit: onSubmit,
|
|
308
|
-
occurrenceStartAtDate: occurrenceStartAtDate,
|
|
309
309
|
defaultValues: productSetId === (editedProductSet === null || editedProductSet === void 0 ? void 0 : editedProductSet.id) && editedProductSet,
|
|
310
310
|
timeZone: timeZone
|
|
311
311
|
})
|
|
@@ -8,9 +8,8 @@ export interface EventDates {
|
|
|
8
8
|
interface EditEventProductSetProps {
|
|
9
9
|
onSubmit: (value: EditEventFormValues["editedProductSet"]) => void;
|
|
10
10
|
defaultValues?: EditEventFormValues["editedProductSet"];
|
|
11
|
-
occurrenceStartAtDate: string;
|
|
12
11
|
timeZone: string;
|
|
13
12
|
}
|
|
14
|
-
export declare const EditEventProductSet: ({ onSubmit, defaultValues,
|
|
13
|
+
export declare const EditEventProductSet: ({ onSubmit, defaultValues, timeZone, }: EditEventProductSetProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
14
|
export {};
|
|
16
15
|
//# sourceMappingURL=EditEventProductSet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditEventProductSet.d.ts","sourceRoot":"","sources":["../../../../../../src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,UAAU,wBAAwB;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACnE,aAAa,CAAC,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;IACxD,
|
|
1
|
+
{"version":3,"file":"EditEventProductSet.d.ts","sourceRoot":"","sources":["../../../../../../src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,UAAU,wBAAwB;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACnE,aAAa,CAAC,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;IACxD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,mBAAmB,2CAI7B,wBAAwB,4CAmH1B,CAAC"}
|
|
@@ -133,7 +133,7 @@ function _object_spread_props(target, source) {
|
|
|
133
133
|
}
|
|
134
134
|
var DEFAULT_FEE = 5;
|
|
135
135
|
var EditEventProductSet = function(param) {
|
|
136
|
-
var onSubmit = param.onSubmit, defaultValues = param.defaultValues,
|
|
136
|
+
var onSubmit = param.onSubmit, defaultValues = param.defaultValues, timeZone = param.timeZone;
|
|
137
137
|
var companyId = useParams().companyId;
|
|
138
138
|
var _useEventEditProductSetContext = useEventEditProductSetContext(), companies = _useEventEditProductSetContext.companies, isLoading = _useEventEditProductSetContext.isLoading, settings = _useEventEditProductSetContext.settings, smsTemplates = _useEventEditProductSetContext.smsTemplates, systemSettings = _useEventEditProductSetContext.systemSettings, productGroupsData = _useEventEditProductSetContext.productGroupsData, productSetData = _useEventEditProductSetContext.productSetData, venueMapSets = _useEventEditProductSetContext.venueMapSets, emailTemplates = _useEventEditProductSetContext.emailTemplates, fieldSetsData = _useEventEditProductSetContext.fieldSetsData;
|
|
139
139
|
var t = useTranslation("Design").t;
|
|
@@ -214,7 +214,6 @@ var EditEventProductSet = function(param) {
|
|
|
214
214
|
fee: feeInPercent,
|
|
215
215
|
isEventEditProductSet: true,
|
|
216
216
|
isOverrides: true,
|
|
217
|
-
occurrenceStartAtDate: occurrenceStartAtDate,
|
|
218
217
|
workHours: undefined,
|
|
219
218
|
timeZone: timeZone
|
|
220
219
|
}),
|
package/dist/index.js
CHANGED
|
@@ -87,6 +87,7 @@ export { ProductSetControl } from './product-set/control/ProductSetControl.js';
|
|
|
87
87
|
export { ProductSetDepositPaidControl } from './product-set/deposit-paid/ProductSetDepositPaidControl.js';
|
|
88
88
|
export { DeleteFieldButton } from './product-set/elements/DeleteFieldButton.js';
|
|
89
89
|
export { ProductSetForm } from './product-set/form/ProductSetForm.js';
|
|
90
|
+
export { ProductSetNameControl } from './product-set/form/ProductSetNameControl.js';
|
|
90
91
|
export { ProductSetPopover } from './product-set/popover/ProductSetPopover.js';
|
|
91
92
|
export { ProductBookingManagementControl } from './product-set/product/booking-management/ProductBookingManagementControl.js';
|
|
92
93
|
export { ProductDepositControl } from './product-set/product/deposit/ProductDepositControl.js';
|
|
@@ -8,6 +8,8 @@ export type ConfirmModalTypes = (typeof ConfirmModalType)[keyof typeof ConfirmMo
|
|
|
8
8
|
export interface ConfirmModalProps {
|
|
9
9
|
type?: ConfirmModalTypes;
|
|
10
10
|
children?: (confirm: (action: ConfirmAction) => void) => ReactNode;
|
|
11
|
+
confirmationHandler?: () => Promise<boolean | undefined>;
|
|
12
|
+
disabledButtons?: boolean;
|
|
11
13
|
title?: string;
|
|
12
14
|
content?: string | ReactNode;
|
|
13
15
|
onClose?: () => void;
|
|
@@ -16,5 +18,5 @@ export interface ConfirmModalProps {
|
|
|
16
18
|
export declare const CONFIRM_MODAL_ACTION_DECLINE = "confirm-modal-decline";
|
|
17
19
|
export declare const CONFIRM_MODAL_ACTION_CONFIRM = "confirm-modal-confirm";
|
|
18
20
|
export declare const CONFIRM_MODAL_ACTIONS: readonly string[];
|
|
19
|
-
export declare function ConfirmModal({ type, children, onClose, title, content, hideButtons, }: ConfirmModalProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function ConfirmModal({ type, children, onClose, confirmationHandler, title, disabledButtons, content, hideButtons, }: ConfirmModalProps): import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
//# sourceMappingURL=ConfirmModal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/modals/confirmation/ConfirmModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAA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C;AACpE,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAGlD,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAC3B,IAAgB,EAChB,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,KAAK,EACL,eAAe,EACf,OAAO,EACP,WAAmB,GACpB,EAAE,iBAAiB,2CA+GnB"}
|
|
@@ -17,6 +17,35 @@ function _array_like_to_array(arr, len) {
|
|
|
17
17
|
function _array_with_holes(arr) {
|
|
18
18
|
if (Array.isArray(arr)) return arr;
|
|
19
19
|
}
|
|
20
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
21
|
+
try {
|
|
22
|
+
var info = gen[key](arg);
|
|
23
|
+
var value = info.value;
|
|
24
|
+
} catch (error) {
|
|
25
|
+
reject(error);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (info.done) {
|
|
29
|
+
resolve(value);
|
|
30
|
+
} else {
|
|
31
|
+
Promise.resolve(value).then(_next, _throw);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function _async_to_generator(fn) {
|
|
35
|
+
return function() {
|
|
36
|
+
var self = this, args = arguments;
|
|
37
|
+
return new Promise(function(resolve, reject) {
|
|
38
|
+
var gen = fn.apply(self, args);
|
|
39
|
+
function _next(value) {
|
|
40
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
41
|
+
}
|
|
42
|
+
function _throw(err) {
|
|
43
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
44
|
+
}
|
|
45
|
+
_next(undefined);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
}
|
|
20
49
|
function _iterable_to_array_limit(arr, i) {
|
|
21
50
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
22
51
|
if (_i == null) return;
|
|
@@ -55,6 +84,101 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
55
84
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
56
85
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
57
86
|
}
|
|
87
|
+
function _ts_generator(thisArg, body) {
|
|
88
|
+
var f, y, t, g, _ = {
|
|
89
|
+
label: 0,
|
|
90
|
+
sent: function() {
|
|
91
|
+
if (t[0] & 1) throw t[1];
|
|
92
|
+
return t[1];
|
|
93
|
+
},
|
|
94
|
+
trys: [],
|
|
95
|
+
ops: []
|
|
96
|
+
};
|
|
97
|
+
return g = {
|
|
98
|
+
next: verb(0),
|
|
99
|
+
"throw": verb(1),
|
|
100
|
+
"return": verb(2)
|
|
101
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
102
|
+
return this;
|
|
103
|
+
}), g;
|
|
104
|
+
function verb(n) {
|
|
105
|
+
return function(v) {
|
|
106
|
+
return step([
|
|
107
|
+
n,
|
|
108
|
+
v
|
|
109
|
+
]);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function step(op) {
|
|
113
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
114
|
+
while(_)try {
|
|
115
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
116
|
+
if (y = 0, t) op = [
|
|
117
|
+
op[0] & 2,
|
|
118
|
+
t.value
|
|
119
|
+
];
|
|
120
|
+
switch(op[0]){
|
|
121
|
+
case 0:
|
|
122
|
+
case 1:
|
|
123
|
+
t = op;
|
|
124
|
+
break;
|
|
125
|
+
case 4:
|
|
126
|
+
_.label++;
|
|
127
|
+
return {
|
|
128
|
+
value: op[1],
|
|
129
|
+
done: false
|
|
130
|
+
};
|
|
131
|
+
case 5:
|
|
132
|
+
_.label++;
|
|
133
|
+
y = op[1];
|
|
134
|
+
op = [
|
|
135
|
+
0
|
|
136
|
+
];
|
|
137
|
+
continue;
|
|
138
|
+
case 7:
|
|
139
|
+
op = _.ops.pop();
|
|
140
|
+
_.trys.pop();
|
|
141
|
+
continue;
|
|
142
|
+
default:
|
|
143
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
144
|
+
_ = 0;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
148
|
+
_.label = op[1];
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
152
|
+
_.label = t[1];
|
|
153
|
+
t = op;
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
if (t && _.label < t[2]) {
|
|
157
|
+
_.label = t[2];
|
|
158
|
+
_.ops.push(op);
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
if (t[2]) _.ops.pop();
|
|
162
|
+
_.trys.pop();
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
op = body.call(thisArg, _);
|
|
166
|
+
} catch (e) {
|
|
167
|
+
op = [
|
|
168
|
+
6,
|
|
169
|
+
e
|
|
170
|
+
];
|
|
171
|
+
y = 0;
|
|
172
|
+
} finally{
|
|
173
|
+
f = t = 0;
|
|
174
|
+
}
|
|
175
|
+
if (op[0] & 5) throw op[1];
|
|
176
|
+
return {
|
|
177
|
+
value: op[0] ? op[1] : void 0,
|
|
178
|
+
done: true
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
}
|
|
58
182
|
var ConfirmModalType = {
|
|
59
183
|
remove: "remove",
|
|
60
184
|
default: "default"
|
|
@@ -66,7 +190,7 @@ var CONFIRM_MODAL_ACTIONS = [
|
|
|
66
190
|
CONFIRM_MODAL_ACTION_CONFIRM
|
|
67
191
|
];
|
|
68
192
|
function ConfirmModal(param) {
|
|
69
|
-
var _param_type = param.type, type = _param_type === void 0 ? "default" : _param_type, children = param.children, onClose = param.onClose, title = param.title, content = param.content, _param_hideButtons = param.hideButtons, hideButtons = _param_hideButtons === void 0 ? false : _param_hideButtons;
|
|
193
|
+
var _param_type = param.type, type = _param_type === void 0 ? "default" : _param_type, children = param.children, onClose = param.onClose, confirmationHandler = param.confirmationHandler, title = param.title, disabledButtons = param.disabledButtons, content = param.content, _param_hideButtons = param.hideButtons, hideButtons = _param_hideButtons === void 0 ? false : _param_hideButtons;
|
|
70
194
|
var t = useTranslation("Design").t;
|
|
71
195
|
var actionRef = useRef();
|
|
72
196
|
var _useState = _sliced_to_array(useState(false), 2), isOpen = _useState[0], setIsOpen = _useState[1];
|
|
@@ -76,14 +200,49 @@ function ConfirmModal(param) {
|
|
|
76
200
|
return true;
|
|
77
201
|
});
|
|
78
202
|
};
|
|
79
|
-
var handleConfirmation = function(
|
|
80
|
-
e
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
203
|
+
var handleConfirmation = function() {
|
|
204
|
+
var _ref = _async_to_generator(function(e) {
|
|
205
|
+
var res;
|
|
206
|
+
return _ts_generator(this, function(_state) {
|
|
207
|
+
switch(_state.label){
|
|
208
|
+
case 0:
|
|
209
|
+
e.stopPropagation();
|
|
210
|
+
if (!actionRef.current && !confirmationHandler) return [
|
|
211
|
+
2
|
|
212
|
+
];
|
|
213
|
+
if (!confirmationHandler) return [
|
|
214
|
+
3,
|
|
215
|
+
2
|
|
216
|
+
];
|
|
217
|
+
return [
|
|
218
|
+
4,
|
|
219
|
+
confirmationHandler()
|
|
220
|
+
];
|
|
221
|
+
case 1:
|
|
222
|
+
res = _state.sent();
|
|
223
|
+
if (res) {
|
|
224
|
+
setIsOpen(function() {
|
|
225
|
+
return false;
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return [
|
|
229
|
+
2
|
|
230
|
+
];
|
|
231
|
+
case 2:
|
|
232
|
+
actionRef.current();
|
|
233
|
+
setIsOpen(function() {
|
|
234
|
+
return false;
|
|
235
|
+
});
|
|
236
|
+
return [
|
|
237
|
+
2
|
|
238
|
+
];
|
|
239
|
+
}
|
|
240
|
+
});
|
|
85
241
|
});
|
|
86
|
-
|
|
242
|
+
return function handleConfirmation(e) {
|
|
243
|
+
return _ref.apply(this, arguments);
|
|
244
|
+
};
|
|
245
|
+
}();
|
|
87
246
|
var handleClose = function(e) {
|
|
88
247
|
e.stopPropagation();
|
|
89
248
|
setIsOpen(function() {
|
|
@@ -113,6 +272,7 @@ function ConfirmModal(param) {
|
|
|
113
272
|
/*#__PURE__*/ jsx(Button, {
|
|
114
273
|
variant: "danger",
|
|
115
274
|
className: "btn-sm rounded",
|
|
275
|
+
disabled: disabledButtons,
|
|
116
276
|
onClick: handleClose,
|
|
117
277
|
"data-id": CONFIRM_MODAL_ACTION_DECLINE,
|
|
118
278
|
children: /*#__PURE__*/ jsx(FaTimes, {
|
|
@@ -133,11 +293,13 @@ function ConfirmModal(param) {
|
|
|
133
293
|
variant: "outline",
|
|
134
294
|
className: "cancel-button",
|
|
135
295
|
onClick: handleClose,
|
|
296
|
+
disabled: disabledButtons,
|
|
136
297
|
"data-id": CONFIRM_MODAL_ACTION_DECLINE,
|
|
137
298
|
children: t("cancel")
|
|
138
299
|
}),
|
|
139
300
|
/*#__PURE__*/ jsx(Button, {
|
|
140
301
|
variant: "danger",
|
|
302
|
+
disabled: disabledButtons,
|
|
141
303
|
onClick: handleConfirmation,
|
|
142
304
|
"data-id": CONFIRM_MODAL_ACTION_CONFIRM,
|
|
143
305
|
children: t("remove")
|
|
@@ -147,12 +309,14 @@ function ConfirmModal(param) {
|
|
|
147
309
|
children: [
|
|
148
310
|
/*#__PURE__*/ jsx(Button, {
|
|
149
311
|
variant: "danger",
|
|
312
|
+
disabled: disabledButtons,
|
|
150
313
|
onClick: handleClose,
|
|
151
314
|
"data-id": CONFIRM_MODAL_ACTION_DECLINE,
|
|
152
315
|
children: t("decline")
|
|
153
316
|
}),
|
|
154
317
|
/*#__PURE__*/ jsx(Button, {
|
|
155
318
|
variant: "success",
|
|
319
|
+
disabled: disabledButtons,
|
|
156
320
|
onClick: handleConfirmation,
|
|
157
321
|
"data-id": CONFIRM_MODAL_ACTION_CONFIRM,
|
|
158
322
|
children: t("confirm")
|
|
@@ -3,10 +3,14 @@ export interface ProductSetCardProps extends HasPermissionProp {
|
|
|
3
3
|
name: string;
|
|
4
4
|
rrule?: string;
|
|
5
5
|
href: string;
|
|
6
|
-
|
|
6
|
+
duplicateProductSetName: string;
|
|
7
|
+
onChangeDuplicateProductSetName: (value: string) => void;
|
|
8
|
+
onCopy: () => Promise<boolean | undefined>;
|
|
7
9
|
onRemove: () => void;
|
|
10
|
+
isLoading?: boolean;
|
|
8
11
|
className?: string;
|
|
9
12
|
override?: number;
|
|
13
|
+
duplicateProductSetError?: string;
|
|
10
14
|
}
|
|
11
|
-
export declare function ProductSetCard({ name, rrule, href, onCopy, onRemove, className, hasPermission, override, }: ProductSetCardProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function ProductSetCard({ name, rrule, href, onCopy, onRemove, onChangeDuplicateProductSetName, duplicateProductSetName, duplicateProductSetError, isLoading, className, hasPermission, override, }: ProductSetCardProps): import("react/jsx-runtime").JSX.Element;
|
|
12
16
|
//# sourceMappingURL=ProductSetCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSetCard.d.ts","sourceRoot":"","sources":["../../../src/product-set/card/ProductSetCard.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductSetCard.d.ts","sourceRoot":"","sources":["../../../src/product-set/card/ProductSetCard.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAOvF,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB,EAAE,MAAM,CAAC;IAChC,+BAA+B,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,+BAA+B,EAC/B,uBAAuB,EACvB,wBAAwB,EACxB,SAAS,EACT,SAAc,EACd,aAAoB,EACpB,QAAY,GACb,EAAE,mBAAmB,2CAuIrB"}
|
|
@@ -9,6 +9,7 @@ import RouteService from '@licklist/plugins/dist/services/Route/RouteService';
|
|
|
9
9
|
import { FaEye, FaTrashAlt, FaEllipsisH } from 'react-icons/fa';
|
|
10
10
|
import { ConfirmModal } from '../../modals/confirmation/ConfirmModal.js';
|
|
11
11
|
import { MenuButton } from '../../table/MenuButton.js';
|
|
12
|
+
import { ProductSetNameControl } from '../form/ProductSetNameControl.js';
|
|
12
13
|
|
|
13
14
|
function _array_like_to_array(arr, len) {
|
|
14
15
|
if (len == null || len > arr.length) len = arr.length;
|
|
@@ -57,21 +58,20 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
57
58
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
58
59
|
}
|
|
59
60
|
function ProductSetCard(param) {
|
|
60
|
-
var name = param.name, rrule = param.rrule, href = param.href, onCopy = param.onCopy, onRemove = param.onRemove, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, _param_override = param.override, override = _param_override === void 0 ? 0 : _param_override;
|
|
61
|
+
var name = param.name, rrule = param.rrule, href = param.href, onCopy = param.onCopy, onRemove = param.onRemove, onChangeDuplicateProductSetName = param.onChangeDuplicateProductSetName, duplicateProductSetName = param.duplicateProductSetName, duplicateProductSetError = param.duplicateProductSetError, isLoading = param.isLoading, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, _param_override = param.override, override = _param_override === void 0 ? 0 : _param_override;
|
|
61
62
|
var t = useTranslation("Design").t;
|
|
62
63
|
var popoverId = useId();
|
|
63
64
|
var productSetCardClasses = "product-set-card ".concat(className);
|
|
64
65
|
var _useState = _sliced_to_array(useState(false), 2), isOverlayVisibile = _useState[0], setIsOverlayVisible = _useState[1];
|
|
65
|
-
|
|
66
|
+
var onCardClick = function() {
|
|
67
|
+
RouteService.redirectTo(href);
|
|
68
|
+
};
|
|
69
|
+
return(// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
70
|
+
/*#__PURE__*/ jsx("div", {
|
|
66
71
|
role: "button",
|
|
67
72
|
tabIndex: 0,
|
|
68
73
|
className: "border-0 product-set-card-wrapper w-100 pb-0",
|
|
69
|
-
onClick:
|
|
70
|
-
return RouteService.redirectTo(href);
|
|
71
|
-
},
|
|
72
|
-
onKeyUp: function() {
|
|
73
|
-
return RouteService.redirectTo(href);
|
|
74
|
-
},
|
|
74
|
+
onClick: onCardClick,
|
|
75
75
|
children: /*#__PURE__*/ jsxs("div", {
|
|
76
76
|
className: productSetCardClasses,
|
|
77
77
|
children: [
|
|
@@ -83,7 +83,6 @@ function ProductSetCard(param) {
|
|
|
83
83
|
/*#__PURE__*/ jsxs("div", {
|
|
84
84
|
children: [
|
|
85
85
|
name,
|
|
86
|
-
" ",
|
|
87
86
|
rrule && "(".concat(RRule.fromString(rrule).toText(), ")")
|
|
88
87
|
]
|
|
89
88
|
}),
|
|
@@ -120,12 +119,27 @@ function ProductSetCard(param) {
|
|
|
120
119
|
/*#__PURE__*/ jsx(ListGroup.Item, {
|
|
121
120
|
action: true,
|
|
122
121
|
as: "div",
|
|
122
|
+
role: "button",
|
|
123
|
+
tabIndex: 0,
|
|
124
|
+
onClick: function(e) {
|
|
125
|
+
return e.stopPropagation();
|
|
126
|
+
},
|
|
123
127
|
children: Boolean(onCopy) && /*#__PURE__*/ jsx(ConfirmModal, {
|
|
128
|
+
// confirm function memoize the callback function and it leads to bugs
|
|
129
|
+
confirmationHandler: onCopy,
|
|
130
|
+
disabledButtons: isLoading,
|
|
131
|
+
content: /*#__PURE__*/ jsx(ProductSetNameControl, {
|
|
132
|
+
value: duplicateProductSetName,
|
|
133
|
+
onChange: onChangeDuplicateProductSetName,
|
|
134
|
+
error: duplicateProductSetError
|
|
135
|
+
}),
|
|
124
136
|
children: function(confirm) {
|
|
125
137
|
return /*#__PURE__*/ jsx(MenuButton, {
|
|
126
138
|
onClick: function() {
|
|
127
139
|
setIsOverlayVisible(false);
|
|
128
|
-
|
|
140
|
+
onChangeDuplicateProductSetName(name);
|
|
141
|
+
// confirm function memoize the callback function and it leads to bugs
|
|
142
|
+
confirm(function() {});
|
|
129
143
|
},
|
|
130
144
|
name: t("duplicate"),
|
|
131
145
|
className: "product-set-card-menu-item-text"
|
|
@@ -137,6 +151,11 @@ function ProductSetCard(param) {
|
|
|
137
151
|
action: true,
|
|
138
152
|
className: "text-danger",
|
|
139
153
|
as: "div",
|
|
154
|
+
role: "button",
|
|
155
|
+
tabIndex: 0,
|
|
156
|
+
onClick: function(e) {
|
|
157
|
+
return e.stopPropagation();
|
|
158
|
+
},
|
|
140
159
|
children: Boolean(onRemove) && /*#__PURE__*/ jsx(ConfirmModal, {
|
|
141
160
|
children: function(confirm) {
|
|
142
161
|
return /*#__PURE__*/ jsx(MenuButton, {
|
|
@@ -172,7 +191,7 @@ function ProductSetCard(param) {
|
|
|
172
191
|
})
|
|
173
192
|
]
|
|
174
193
|
})
|
|
175
|
-
});
|
|
194
|
+
}));
|
|
176
195
|
}
|
|
177
196
|
|
|
178
197
|
export { ProductSetCard };
|
|
@@ -44,9 +44,7 @@ export interface ProductSetControlProps {
|
|
|
44
44
|
workHours: WorkHour[] | undefined;
|
|
45
45
|
providerHasBookingManagement?: boolean;
|
|
46
46
|
isOverrides?: boolean;
|
|
47
|
-
occurrenceStartAtDate?: string;
|
|
48
47
|
isCreateNewOverrides?: boolean;
|
|
49
|
-
timeZone: string;
|
|
50
48
|
}
|
|
51
|
-
export declare function ProductSetControl({ companyName, isLoading, fee, fieldSets, emailTemplates, smsTemplates, isEventEditProductSet, isCreateAction, showEmailTemplate, showSmsTemplate, workHours, providerHasBookingManagement, isOverrides,
|
|
49
|
+
export declare function ProductSetControl({ companyName, isLoading, fee, fieldSets, emailTemplates, smsTemplates, isEventEditProductSet, isCreateAction, showEmailTemplate, showSmsTemplate, workHours, providerHasBookingManagement, isOverrides, isCreateNewOverrides, }: ProductSetControlProps): import("react/jsx-runtime").JSX.Element;
|
|
52
50
|
//# sourceMappingURL=ProductSetControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSetControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetControl.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductSetControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/ProductSetControl.tsx"],"names":[],"mappings":"AAIA,OAAO,EAOL,mBAAmB,EACnB,cAAc,EAEd,gBAAgB,EACjB,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAC;AAGhG,OAAO,EAAE,QAAQ,EAAE,MA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