@licklist/design 0.71.18-dev.16 → 0.71.18-dev.18

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.
@@ -6,12 +6,13 @@ interface IntervalInputProps {
6
6
  productSetId?: number;
7
7
  disabled?: boolean;
8
8
  disabledRecurrent?: boolean;
9
+ isCopyCreate?: boolean;
9
10
  }
10
11
  export interface IntervalInputValues {
11
12
  start: string;
12
13
  end: string;
13
14
  rrule: string | null;
14
15
  }
15
- export declare function IntervalInput({ disabled, editedProductSet, productSetId, productSets, disabledRecurrent, }: IntervalInputProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function IntervalInput({ disabled, editedProductSet, productSetId, productSets, disabledRecurrent, isCopyCreate }: IntervalInputProps): import("react/jsx-runtime").JSX.Element;
16
17
  export {};
17
18
  //# sourceMappingURL=IntervalInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntervalInput.d.ts","sourceRoot":"","sources":["../../../src/events/edit-event-modal/IntervalInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AAIxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG7D,UAAU,kBAAkB;IAC1B,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAyB,GAC1B,EAAE,kBAAkB,2CA+JpB"}
1
+ {"version":3,"file":"IntervalInput.d.ts","sourceRoot":"","sources":["../../../src/events/edit-event-modal/IntervalInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AAIxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG7D,UAAU,kBAAkB;IAC1B,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAyB,EACzB,YAAoB,EACrB,EAAE,kBAAkB,2CAkKpB"}
@@ -110,7 +110,7 @@ function _unsupported_iterable_to_array(o, minLen) {
110
110
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
111
111
  }
112
112
  function IntervalInput(param) {
113
- var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, editedProductSet = param.editedProductSet, productSetId = param.productSetId, productSets = param.productSets, _param_disabledRecurrent = param.disabledRecurrent, disabledRecurrent = _param_disabledRecurrent === void 0 ? false : _param_disabledRecurrent;
113
+ var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, editedProductSet = param.editedProductSet, productSetId = param.productSetId, productSets = param.productSets, _param_disabledRecurrent = param.disabledRecurrent, disabledRecurrent = _param_disabledRecurrent === void 0 ? false : _param_disabledRecurrent, _param_isCopyCreate = param.isCopyCreate, isCopyCreate = _param_isCopyCreate === void 0 ? false : _param_isCopyCreate;
114
114
  var _errors_start, _errors_end;
115
115
  var t = useTranslation([
116
116
  'Design',
@@ -152,7 +152,14 @@ function IntervalInput(param) {
152
152
  }, [
153
153
  editedProductSet
154
154
  ]);
155
- useEffect(function() {});
155
+ useEffect(function() {
156
+ if (!isCopyCreate) return;
157
+ setRecurrent(false);
158
+ setValue('rrule', null);
159
+ // eslint-disable-next-line react-hooks/exhaustive-deps
160
+ }, [
161
+ isCopyCreate
162
+ ]);
156
163
  useEffect(function() {
157
164
  if (!productSets) return;
158
165
  var isOverridenProductSet = productSets.find(function(productSet) {
@@ -37,6 +37,7 @@ export interface EditEventFormProps extends HasPermissionProp {
37
37
  eventProductSet?: ProductSet;
38
38
  overrideNameError?: string;
39
39
  disabledRecurrent?: boolean;
40
+ isCopyCreate?: boolean;
40
41
  }
41
- export declare const EditEventForm: ({ disabled, categories, title, hasPermission, defaultEventValues, serverErrors, onSaveEvent, productSets, createProductSet, setEditProductSetId, isExternalPaymentLinkEnabled, timeZone, eventProductSet, overrideNameError, disabledRecurrent, }: EditEventFormProps) => import("react/jsx-runtime").JSX.Element;
42
+ export declare const EditEventForm: ({ disabled, categories, title, hasPermission, defaultEventValues, serverErrors, onSaveEvent, productSets, createProductSet, setEditProductSetId, isExternalPaymentLinkEnabled, timeZone, eventProductSet, overrideNameError, disabledRecurrent, isCopyCreate, }: EditEventFormProps) => import("react/jsx-runtime").JSX.Element;
42
43
  //# sourceMappingURL=EditEventForm.d.ts.map
@@ -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,CAAA;AAM7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAGtF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAG3E,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAS5D,OAAO,EAAiB,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAA;AAGlF,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAA;IACzB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;IACtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,kBAAkB,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACjD,YAAY,CAAC,EAAE,WAAW,CAAA;IAC1B,WAAW,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAClD,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,gBAAgB,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA;IACtD,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,UAAU,CAAA;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAOD,eAAO,MAAM,aAAa,sPAgBvB,kBAAkB,4CAkWpB,CAAA"}
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,CAAA;AAM7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAGtF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAG3E,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAS5D,OAAO,EAAiB,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAA;AAGlF,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAA;IACzB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;IACtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,kBAAkB,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACjD,YAAY,CAAC,EAAE,WAAW,CAAA;IAC1B,WAAW,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAClD,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,gBAAgB,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAA;IACtD,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,UAAU,CAAA;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAOD,eAAO,MAAM,aAAa,oQAiBvB,kBAAkB,4CAmWpB,CAAA"}
@@ -139,7 +139,7 @@ var eventImageTypes = {
139
139
  uploadCover: IMAGE_TYPE_MAP[IMAGE_TYPE_COVER]
140
140
  };
141
141
  var EditEventForm = function(param) {
142
- var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, categories = param.categories, title = param.title, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, defaultEventValues = param.defaultEventValues, serverErrors = param.serverErrors, onSaveEvent = param.onSaveEvent, productSets = param.productSets, createProductSet = param.createProductSet, setEditProductSetId = param.setEditProductSetId, isExternalPaymentLinkEnabled = param.isExternalPaymentLinkEnabled, timeZone = param.timeZone, eventProductSet = param.eventProductSet, overrideNameError = param.overrideNameError, _param_disabledRecurrent = param.disabledRecurrent, disabledRecurrent = _param_disabledRecurrent === void 0 ? false : _param_disabledRecurrent;
142
+ var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, categories = param.categories, title = param.title, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, defaultEventValues = param.defaultEventValues, serverErrors = param.serverErrors, onSaveEvent = param.onSaveEvent, productSets = param.productSets, createProductSet = param.createProductSet, setEditProductSetId = param.setEditProductSetId, isExternalPaymentLinkEnabled = param.isExternalPaymentLinkEnabled, timeZone = param.timeZone, eventProductSet = param.eventProductSet, overrideNameError = param.overrideNameError, _param_disabledRecurrent = param.disabledRecurrent, disabledRecurrent = _param_disabledRecurrent === void 0 ? false : _param_disabledRecurrent, _param_isCopyCreate = param.isCopyCreate, isCopyCreate = _param_isCopyCreate === void 0 ? false : _param_isCopyCreate;
143
143
  var _defaultEventValues_rrule, _defaultEventValues_rrule1, _errors_name, _errors_externalPaymentLink, _errors_integrationUrl;
144
144
  var t = useTranslation([
145
145
  'Design',
@@ -315,7 +315,8 @@ var EditEventForm = function(param) {
315
315
  productSetId: productSetId,
316
316
  productSets: productSets,
317
317
  disabledRecurrent: disabledRecurrent,
318
- editedProductSet: editedProductSet
318
+ editedProductSet: editedProductSet,
319
+ isCopyCreate: isCopyCreate
319
320
  }, watch('name')),
320
321
  categories.length !== 0 && /*#__PURE__*/ jsx(Form.Group, {
321
322
  children: /*#__PURE__*/ jsx(Accordion, {
@@ -8,6 +8,9 @@ export declare const RECURRENT_MODE_TYPES_LIST: {
8
8
  thisAndFollowingEvents: number;
9
9
  allEvents: number;
10
10
  };
11
+ export declare const RECURRENT_MODE_TYPES_WITHOUT_ALL: {
12
+ thisEvent: number;
13
+ };
11
14
  export type RecurrentEventMode = (typeof MODES)[number];
12
15
  export type EditRecurrentEventModalValues = {
13
16
  mode: RecurrentEventMode;
@@ -18,7 +21,8 @@ export type EditRecurrentEventModalProps = {
18
21
  onHide: () => void;
19
22
  title: string;
20
23
  onSubmit: (values: EditRecurrentEventModalValues) => void;
24
+ isDateWasChanged?: boolean;
21
25
  };
22
- export declare const EditRecurrentEventModal: ({ disabled, isOpen, onHide, title, onSubmit, }: EditRecurrentEventModalProps) => import("react/jsx-runtime").JSX.Element;
26
+ export declare const EditRecurrentEventModal: ({ disabled, isOpen, onHide, title, onSubmit, isDateWasChanged }: EditRecurrentEventModalProps) => import("react/jsx-runtime").JSX.Element;
23
27
  export {};
24
28
  //# sourceMappingURL=EditRecurrentEventModal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditRecurrentEventModal.d.ts","sourceRoot":"","sources":["../../../src/events/edit-recurrent-event-modal/EditRecurrentEventModal.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,cAAc,CAAA;AAC1C,eAAO,MAAM,8BAA8B,2BAA2B,CAAA;AACtE,eAAO,MAAM,eAAe,cAAc,CAAA;AAE1C,QAAA,MAAM,KAAK,+DAID,CAAA;AAEV,eAAO,MAAM,2BAA2B,cAAkB,CAAA;AAE1D,eAAO,MAAM,yBAAyB;;;;CAIrC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,kBAAkB,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,MAAM,EAAE,6BAA6B,KAAK,IAAI,CAAA;CAC1D,CAAA;AAED,eAAO,MAAM,uBAAuB,mDAMjC,4BAA4B,4CAgF9B,CAAA"}
1
+ {"version":3,"file":"EditRecurrentEventModal.d.ts","sourceRoot":"","sources":["../../../src/events/edit-recurrent-event-modal/EditRecurrentEventModal.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,cAAc,CAAA;AAC1C,eAAO,MAAM,8BAA8B,2BAA2B,CAAA;AACtE,eAAO,MAAM,eAAe,cAAc,CAAA;AAE1C,QAAA,MAAM,KAAK,+DAID,CAAA;AAEV,eAAO,MAAM,2BAA2B,cAAkB,CAAA;AAE1D,eAAO,MAAM,yBAAyB;;;;CAIrC,CAAA;AAED,eAAO,MAAM,gCAAgC;;CAE5C,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,kBAAkB,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,MAAM,EAAE,6BAA6B,KAAK,IAAI,CAAA;IACzD,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,uBAAuB,oEAOjC,4BAA4B,4CAkF9B,CAAA"}
@@ -23,14 +23,16 @@ var MODE_ALL_EVENTS = 'allEvents';
23
23
  var DEFAULT_RECURRENT_MODE_TYPE = MODE_THIS_EVENT;
24
24
  var _obj;
25
25
  var RECURRENT_MODE_TYPES_LIST = (_obj = {}, _define_property(_obj, MODE_THIS_EVENT, 1), _define_property(_obj, MODE_THIS_AND_FOLLOWING_EVENTS, 2), _define_property(_obj, MODE_ALL_EVENTS, 3), _obj);
26
+ var RECURRENT_MODE_TYPES_WITHOUT_ALL = _define_property({}, MODE_THIS_EVENT, 1);
26
27
  var EditRecurrentEventModal = function(param) {
27
- var disabled = param.disabled, isOpen = param.isOpen, onHide = param.onHide, title = param.title, onSubmit = param.onSubmit;
28
+ var disabled = param.disabled, isOpen = param.isOpen, onHide = param.onHide, title = param.title, onSubmit = param.onSubmit, _param_isDateWasChanged = param.isDateWasChanged, isDateWasChanged = _param_isDateWasChanged === void 0 ? false : _param_isDateWasChanged;
28
29
  var t = useTranslation('Design').t;
29
30
  var _useForm = useForm({
30
31
  defaultValues: {
31
32
  mode: DEFAULT_RECURRENT_MODE_TYPE
32
33
  }
33
34
  }), control = _useForm.control, handleSubmit = _useForm.handleSubmit;
35
+ var recurrentListMode = isDateWasChanged ? RECURRENT_MODE_TYPES_WITHOUT_ALL : RECURRENT_MODE_TYPES_LIST;
34
36
  return /*#__PURE__*/ jsx(Modal, {
35
37
  show: isOpen,
36
38
  onHide: onHide,
@@ -67,7 +69,7 @@ var EditRecurrentEventModal = function(param) {
67
69
  render: function(param) {
68
70
  var _param_field = param.field, value = _param_field.value, onChange = _param_field.onChange;
69
71
  return /*#__PURE__*/ jsx(Fragment, {
70
- children: Object.keys(RECURRENT_MODE_TYPES_LIST).map(function(option) {
72
+ children: Object.keys(recurrentListMode).map(function(option) {
71
73
  return /*#__PURE__*/ jsxs(Form.Check, {
72
74
  type: "radio",
73
75
  id: option,
@@ -120,4 +122,4 @@ var EditRecurrentEventModal = function(param) {
120
122
  });
121
123
  };
122
124
 
123
- export { DEFAULT_RECURRENT_MODE_TYPE, EditRecurrentEventModal, MODE_ALL_EVENTS, MODE_THIS_AND_FOLLOWING_EVENTS, MODE_THIS_EVENT, RECURRENT_MODE_TYPES_LIST };
125
+ export { DEFAULT_RECURRENT_MODE_TYPE, EditRecurrentEventModal, MODE_ALL_EVENTS, MODE_THIS_AND_FOLLOWING_EVENTS, MODE_THIS_EVENT, RECURRENT_MODE_TYPES_LIST, RECURRENT_MODE_TYPES_WITHOUT_ALL };
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ export { ErrorFallback } from './error/ErrorFallback.js';
23
23
  export { ProductSetShortForm } from './events/edit-event-modal/component/ProductSetShortForm/ProductSetShortForm.js';
24
24
  export { SelectEventProductSet } from './events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js';
25
25
  export { EditEventForm } from './events/edit-event-modal/component/EditEventForm/EditEventForm.js';
26
- export { DEFAULT_RECURRENT_MODE_TYPE, EditRecurrentEventModal, MODE_ALL_EVENTS, MODE_THIS_AND_FOLLOWING_EVENTS, MODE_THIS_EVENT, RECURRENT_MODE_TYPES_LIST } from './events/edit-recurrent-event-modal/EditRecurrentEventModal.js';
26
+ export { DEFAULT_RECURRENT_MODE_TYPE, EditRecurrentEventModal, MODE_ALL_EVENTS, MODE_THIS_AND_FOLLOWING_EVENTS, MODE_THIS_EVENT, RECURRENT_MODE_TYPES_LIST, RECURRENT_MODE_TYPES_WITHOUT_ALL } from './events/edit-recurrent-event-modal/EditRecurrentEventModal.js';
27
27
  export { EventCard } from './events/event-card/EventCard.js';
28
28
  export { EventCardSkeleton } from './events/event-card/EventCardSkeleton.js';
29
29
  export { EventStatisticModal } from './events/event-statistic-modal/EventStatisticModal.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.71.18-dev.16",
3
+ "version": "0.71.18-dev.18",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -18,6 +18,7 @@ interface IntervalInputProps {
18
18
  productSetId?: number
19
19
  disabled?: boolean
20
20
  disabledRecurrent?: boolean
21
+ isCopyCreate?: boolean
21
22
  }
22
23
 
23
24
  export interface IntervalInputValues {
@@ -32,6 +33,7 @@ export function IntervalInput({
32
33
  productSetId,
33
34
  productSets,
34
35
  disabledRecurrent = false,
36
+ isCopyCreate = false
35
37
  }: IntervalInputProps) {
36
38
  const { t } = useTranslation(['Design', 'Validation'])
37
39
  const {
@@ -74,8 +76,11 @@ export function IntervalInput({
74
76
  }, [editedProductSet])
75
77
 
76
78
  useEffect(() => {
77
-
78
- })
79
+ if (!isCopyCreate) return
80
+ setRecurrent(false)
81
+ setValue('rrule', null)
82
+ // eslint-disable-next-line react-hooks/exhaustive-deps
83
+ }, [isCopyCreate])
79
84
 
80
85
  useEffect(() => {
81
86
  if (!productSets) return
@@ -66,6 +66,7 @@ export interface EditEventFormProps extends HasPermissionProp {
66
66
  eventProductSet?: ProductSet
67
67
  overrideNameError?: string
68
68
  disabledRecurrent?: boolean
69
+ isCopyCreate?: boolean
69
70
  }
70
71
 
71
72
  const eventImageTypes = {
@@ -89,6 +90,7 @@ export const EditEventForm = ({
89
90
  eventProductSet,
90
91
  overrideNameError,
91
92
  disabledRecurrent = false,
93
+ isCopyCreate = false,
92
94
  }: EditEventFormProps) => {
93
95
  const { t } = useTranslation(['Design', 'Validation'])
94
96
 
@@ -286,6 +288,7 @@ export const EditEventForm = ({
286
288
  productSets={productSets}
287
289
  disabledRecurrent={disabledRecurrent}
288
290
  editedProductSet={editedProductSet}
291
+ isCopyCreate={isCopyCreate}
289
292
  />
290
293
  {categories.length !== 0 && (
291
294
  <Form.Group>
@@ -21,6 +21,10 @@ export const RECURRENT_MODE_TYPES_LIST = {
21
21
  [MODE_ALL_EVENTS]: 3,
22
22
  }
23
23
 
24
+ export const RECURRENT_MODE_TYPES_WITHOUT_ALL = {
25
+ [MODE_THIS_EVENT]: 1,
26
+ }
27
+
24
28
  export type RecurrentEventMode = (typeof MODES)[number]
25
29
 
26
30
  export type EditRecurrentEventModalValues = {
@@ -33,6 +37,7 @@ export type EditRecurrentEventModalProps = {
33
37
  onHide: () => void
34
38
  title: string
35
39
  onSubmit: (values: EditRecurrentEventModalValues) => void
40
+ isDateWasChanged?: boolean
36
41
  }
37
42
 
38
43
  export const EditRecurrentEventModal = ({
@@ -41,6 +46,7 @@ export const EditRecurrentEventModal = ({
41
46
  onHide,
42
47
  title,
43
48
  onSubmit,
49
+ isDateWasChanged = false
44
50
  }: EditRecurrentEventModalProps) => {
45
51
  const { t } = useTranslation('Design')
46
52
 
@@ -50,6 +56,8 @@ export const EditRecurrentEventModal = ({
50
56
  },
51
57
  })
52
58
 
59
+ const recurrentListMode = isDateWasChanged? RECURRENT_MODE_TYPES_WITHOUT_ALL : RECURRENT_MODE_TYPES_LIST
60
+
53
61
  return (
54
62
  <Modal
55
63
  show={isOpen}
@@ -75,7 +83,7 @@ export const EditRecurrentEventModal = ({
75
83
  <Controller
76
84
  render={({ field: { value, onChange } }) => (
77
85
  <>
78
- {Object.keys(RECURRENT_MODE_TYPES_LIST).map((option) => (
86
+ {Object.keys(recurrentListMode).map((option) => (
79
87
  <Form.Check
80
88
  type='radio'
81
89
  id={option}
package/yarn.lock CHANGED
@@ -9889,9 +9889,9 @@ __metadata:
9889
9889
  linkType: hard
9890
9890
 
9891
9891
  "electron-to-chromium@npm:^1.3.564, electron-to-chromium@npm:^1.5.73":
9892
- version: 1.5.107
9893
- resolution: "electron-to-chromium@npm:1.5.107"
9894
- checksum: 10c0/3ca6eb5b5f05b8652d3ff4f925d56671cd89eff230dca11a3a8fe5b999dd497afea7fe4f3605974cbecdc17658361c2f78cc3bbfc785fc9afc0e87ba4ab90f07
9892
+ version: 1.5.109
9893
+ resolution: "electron-to-chromium@npm:1.5.109"
9894
+ checksum: 10c0/19d86b95b1288b2e73d9d6084f64b14d4ef2c51d8551d85697ea68da690542d26e6d07878ff053f137e561e3e6c8c2b062d0353bc159930569831f7960bb6ed7
9895
9895
  languageName: node
9896
9896
  linkType: hard
9897
9897
 
@@ -13804,9 +13804,9 @@ __metadata:
13804
13804
  linkType: hard
13805
13805
 
13806
13806
  "libphonenumber-js@npm:^1.9.11":
13807
- version: 1.11.20
13808
- resolution: "libphonenumber-js@npm:1.11.20"
13809
- checksum: 10c0/fb1010bfa5f8682dadfbd9608f76207510e13c456db96d0d534cf727efa2de005cafbb16d016046965894af0787bf567eb5a1a2688d7bb2d5f8b2eebc42437c6
13807
+ version: 1.12.4
13808
+ resolution: "libphonenumber-js@npm:1.12.4"
13809
+ checksum: 10c0/cb05e89278f69aace9347682ae9f7f8f65e2d791442ea1cd09a2a89da889f7038f219cb82472d2f73513ca681d564e4c3036b06c5ad0508116635bc9d453a26c
13810
13810
  languageName: node
13811
13811
  linkType: hard
13812
13812