@licklist/design 0.69.3 → 0.69.5

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 (64) hide show
  1. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +2 -1
  2. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
  3. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +3 -2
  4. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +2 -1
  5. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  6. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +31 -28
  7. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +2 -1
  8. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
  9. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +14 -3
  10. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  11. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +3 -1
  12. package/dist/iframe/activity-card/ActivityCard.d.ts +5 -4
  13. package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
  14. package/dist/iframe/activity-card/ActivityCard.js +52 -40
  15. package/dist/index.js +1 -0
  16. package/dist/modals/confirmation/ConfirmModal.d.ts +3 -1
  17. package/dist/modals/confirmation/ConfirmModal.d.ts.map +1 -1
  18. package/dist/modals/confirmation/ConfirmModal.js +172 -8
  19. package/dist/product-set/card/ProductSetCard.d.ts +6 -2
  20. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  21. package/dist/product-set/card/ProductSetCard.js +30 -11
  22. package/dist/product-set/control/ProductSetControl.d.ts +4 -0
  23. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  24. package/dist/product-set/control/ProductSetControl.js +30 -3
  25. package/dist/product-set/control/ProductSetImageControl.d.ts +2 -0
  26. package/dist/product-set/control/ProductSetImageControl.d.ts.map +1 -0
  27. package/dist/product-set/control/ProductSetImageControl.js +279 -0
  28. package/dist/product-set/form/MobileFooter.d.ts.map +1 -1
  29. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  30. package/dist/product-set/form/ProductSetForm.js +8 -0
  31. package/dist/product-set/form/ProductSetNameControl.d.ts +6 -0
  32. package/dist/product-set/form/ProductSetNameControl.d.ts.map +1 -0
  33. package/dist/product-set/form/ProductSetNameControl.js +35 -0
  34. package/dist/product-set/form/index.d.ts +1 -0
  35. package/dist/product-set/form/index.d.ts.map +1 -1
  36. package/dist/product-set/utils/index.d.ts +7 -0
  37. package/dist/product-set/utils/index.d.ts.map +1 -1
  38. package/dist/product-set/utils/index.js +10 -1
  39. package/dist/styles/activity-card/{GridActivitiesCard.scss → ActivitiesCard.scss} +19 -5
  40. package/dist/styles/activity-card/ListActivitiesCard.scss +12 -42
  41. package/dist/styles/activity-card/_index.scss +1 -1
  42. package/dist/typeahead/Typeahead.d.ts +5 -1
  43. package/dist/typeahead/Typeahead.d.ts.map +1 -1
  44. package/dist/typeahead/Typeahead.js +9 -2
  45. package/package.json +5 -5
  46. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +3 -0
  47. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +86 -85
  48. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +11 -1
  49. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +2 -0
  50. package/src/iframe/activity-card/ActivityCard.tsx +35 -24
  51. package/src/modals/confirmation/ConfirmModal.tsx +19 -3
  52. package/src/product-set/card/ProductSetCard.tsx +47 -8
  53. package/src/product-set/control/ProductSetControl.tsx +52 -52
  54. package/src/product-set/control/ProductSetImageControl.tsx +97 -0
  55. package/src/product-set/form/MobileFooter.tsx +1 -3
  56. package/src/product-set/form/ProductSetForm.tsx +10 -0
  57. package/src/product-set/form/ProductSetNameControl.tsx +27 -0
  58. package/src/product-set/form/index.ts +1 -0
  59. package/src/product-set/utils/index.ts +11 -0
  60. package/src/styles/activity-card/{GridActivitiesCard.scss → ActivitiesCard.scss} +19 -5
  61. package/src/styles/activity-card/ListActivitiesCard.scss +12 -42
  62. package/src/styles/activity-card/_index.scss +1 -1
  63. package/src/typeahead/Typeahead.tsx +15 -1
  64. package/yarn.lock +63 -45
@@ -0,0 +1,279 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useFormContext } from 'react-hook-form';
3
+ import { useImages, HookFormService } from '@licklist/plugins';
4
+ import { IMAGE_TYPE_IMAGE } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper';
5
+ import { useCallback, useEffect } from 'react';
6
+ import { Form } from 'react-bootstrap';
7
+ import { FileUpload } from '../../file-upload/FileUpload.js';
8
+ import { useTranslation } from 'react-i18next';
9
+ import { isEqual } from 'lodash';
10
+
11
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
12
+ try {
13
+ var info = gen[key](arg);
14
+ var value = info.value;
15
+ } catch (error) {
16
+ reject(error);
17
+ return;
18
+ }
19
+ if (info.done) {
20
+ resolve(value);
21
+ } else {
22
+ Promise.resolve(value).then(_next, _throw);
23
+ }
24
+ }
25
+ function _async_to_generator(fn) {
26
+ return function() {
27
+ var self = this, args = arguments;
28
+ return new Promise(function(resolve, reject) {
29
+ var gen = fn.apply(self, args);
30
+ function _next(value) {
31
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
32
+ }
33
+ function _throw(err) {
34
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
35
+ }
36
+ _next(undefined);
37
+ });
38
+ };
39
+ }
40
+ function _define_property(obj, key, value) {
41
+ if (key in obj) {
42
+ Object.defineProperty(obj, key, {
43
+ value: value,
44
+ enumerable: true,
45
+ configurable: true,
46
+ writable: true
47
+ });
48
+ } else {
49
+ obj[key] = value;
50
+ }
51
+ return obj;
52
+ }
53
+ function _object_spread(target) {
54
+ for(var i = 1; i < arguments.length; i++){
55
+ var source = arguments[i] != null ? arguments[i] : {};
56
+ var ownKeys = Object.keys(source);
57
+ if (typeof Object.getOwnPropertySymbols === "function") {
58
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
59
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
60
+ }));
61
+ }
62
+ ownKeys.forEach(function(key) {
63
+ _define_property(target, key, source[key]);
64
+ });
65
+ }
66
+ return target;
67
+ }
68
+ function ownKeys(object, enumerableOnly) {
69
+ var keys = Object.keys(object);
70
+ if (Object.getOwnPropertySymbols) {
71
+ var symbols = Object.getOwnPropertySymbols(object);
72
+ if (enumerableOnly) {
73
+ symbols = symbols.filter(function(sym) {
74
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
75
+ });
76
+ }
77
+ keys.push.apply(keys, symbols);
78
+ }
79
+ return keys;
80
+ }
81
+ function _object_spread_props(target, source) {
82
+ source = source != null ? source : {};
83
+ if (Object.getOwnPropertyDescriptors) {
84
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
85
+ } else {
86
+ ownKeys(Object(source)).forEach(function(key) {
87
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
88
+ });
89
+ }
90
+ return target;
91
+ }
92
+ function _ts_generator(thisArg, body) {
93
+ var f, y, t, g, _ = {
94
+ label: 0,
95
+ sent: function() {
96
+ if (t[0] & 1) throw t[1];
97
+ return t[1];
98
+ },
99
+ trys: [],
100
+ ops: []
101
+ };
102
+ return g = {
103
+ next: verb(0),
104
+ "throw": verb(1),
105
+ "return": verb(2)
106
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
107
+ return this;
108
+ }), g;
109
+ function verb(n) {
110
+ return function(v) {
111
+ return step([
112
+ n,
113
+ v
114
+ ]);
115
+ };
116
+ }
117
+ function step(op) {
118
+ if (f) throw new TypeError("Generator is already executing.");
119
+ while(_)try {
120
+ 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;
121
+ if (y = 0, t) op = [
122
+ op[0] & 2,
123
+ t.value
124
+ ];
125
+ switch(op[0]){
126
+ case 0:
127
+ case 1:
128
+ t = op;
129
+ break;
130
+ case 4:
131
+ _.label++;
132
+ return {
133
+ value: op[1],
134
+ done: false
135
+ };
136
+ case 5:
137
+ _.label++;
138
+ y = op[1];
139
+ op = [
140
+ 0
141
+ ];
142
+ continue;
143
+ case 7:
144
+ op = _.ops.pop();
145
+ _.trys.pop();
146
+ continue;
147
+ default:
148
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
149
+ _ = 0;
150
+ continue;
151
+ }
152
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
153
+ _.label = op[1];
154
+ break;
155
+ }
156
+ if (op[0] === 6 && _.label < t[1]) {
157
+ _.label = t[1];
158
+ t = op;
159
+ break;
160
+ }
161
+ if (t && _.label < t[2]) {
162
+ _.label = t[2];
163
+ _.ops.push(op);
164
+ break;
165
+ }
166
+ if (t[2]) _.ops.pop();
167
+ _.trys.pop();
168
+ continue;
169
+ }
170
+ op = body.call(thisArg, _);
171
+ } catch (e) {
172
+ op = [
173
+ 6,
174
+ e
175
+ ];
176
+ y = 0;
177
+ } finally{
178
+ f = t = 0;
179
+ }
180
+ if (op[0] & 5) throw op[1];
181
+ return {
182
+ value: op[0] ? op[1] : void 0,
183
+ done: true
184
+ };
185
+ }
186
+ }
187
+ var ProductSetImageControl = function() {
188
+ var t = useTranslation('Design').t;
189
+ var _useFormContext = useFormContext(), errors = _useFormContext.formState.errors, setValue = _useFormContext.setValue, watch = _useFormContext.watch, clearErrors = _useFormContext.clearErrors;
190
+ var currentProductSet = watch();
191
+ var _useImages = useImages(null), images = _useImages.images, handleImageRemove = _useImages.handleImageRemove, handleImageUploading = _useImages.handleImageUploading, isImageUploading = _useImages.isLoading, setImages = _useImages.setImages;
192
+ var onFilesChange = useCallback(function() {
193
+ var _ref = _async_to_generator(function(files) {
194
+ var uploadedFiles;
195
+ return _ts_generator(this, function(_state) {
196
+ switch(_state.label){
197
+ case 0:
198
+ return [
199
+ 4,
200
+ handleImageUploading(files, IMAGE_TYPE_IMAGE)
201
+ ];
202
+ case 1:
203
+ uploadedFiles = _state.sent();
204
+ if (!uploadedFiles) return [
205
+ 2
206
+ ];
207
+ setValue('localImageBlobURL', URL.createObjectURL(files[0]));
208
+ return [
209
+ 2
210
+ ];
211
+ }
212
+ });
213
+ });
214
+ return function(files) {
215
+ return _ref.apply(this, arguments);
216
+ };
217
+ }(), // eslint-disable-next-line react-hooks/exhaustive-deps
218
+ [
219
+ handleImageUploading
220
+ ]);
221
+ var onImageRemove = useCallback(function(id, path) {
222
+ handleImageRemove(id, path);
223
+ setValue('localImageBlobURL', undefined);
224
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
225
+ [
226
+ handleImageRemove
227
+ ]);
228
+ useEffect(function() {
229
+ if (!currentProductSet || !currentProductSet.image) return;
230
+ setImages([
231
+ _object_spread_props(_object_spread({}, currentProductSet.image), {
232
+ url: currentProductSet.image.url || (currentProductSet === null || currentProductSet === void 0 ? void 0 : currentProductSet.localImageBlobURL)
233
+ })
234
+ ]);
235
+ // eslint-disable-next-line react-hooks/exhaustive-deps
236
+ }, [
237
+ currentProductSet === null || currentProductSet === void 0 ? void 0 : currentProductSet.image
238
+ ]);
239
+ useEffect(function() {
240
+ if (isEqual(images[0], currentProductSet === null || currentProductSet === void 0 ? void 0 : currentProductSet.image)) return;
241
+ setValue('image', images[0] || null);
242
+ if (images[0]) {
243
+ clearErrors('image');
244
+ }
245
+ // eslint-disable-next-line react-hooks/exhaustive-deps
246
+ }, [
247
+ images
248
+ ]);
249
+ return /*#__PURE__*/ jsxs(Form.Group, {
250
+ controlId: "name",
251
+ children: [
252
+ /*#__PURE__*/ jsx(Form.Control, {
253
+ isInvalid: HookFormService.isInvalid('image', errors),
254
+ hidden: true
255
+ }),
256
+ /*#__PURE__*/ jsx(FileUpload, {
257
+ onFilesChange: onFilesChange,
258
+ allowedExtensions: [
259
+ 'jpeg',
260
+ 'jpg',
261
+ 'png'
262
+ ],
263
+ subTitle: ".jpeg .jpg .png",
264
+ enablePreview: true,
265
+ onFileRemove: onImageRemove,
266
+ defaultFiles: images,
267
+ isLoading: isImageUploading,
268
+ withIcon: true,
269
+ title: t('Design:addImage')
270
+ }),
271
+ /*#__PURE__*/ jsx(Form.Control.Feedback, {
272
+ type: "invalid",
273
+ children: HookFormService.getErrors('image', errors)
274
+ })
275
+ ]
276
+ });
277
+ };
278
+
279
+ export { ProductSetImageControl };
@@ -1 +1 @@
1
- {"version":3,"file":"MobileFooter.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/MobileFooter.tsx"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,4CAY3B"}
1
+ {"version":3,"file":"MobileFooter.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/MobileFooter.tsx"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,4CAU3B"}
@@ -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,oFAAoF,CAAA;AACrI,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAA;AAErF,OAAO,EAEL,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO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U,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,2CA0JrB"}
@@ -5,6 +5,7 @@ import { useForm, FormProvider } from 'react-hook-form';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import FormErrorService from '@licklist/plugins/dist/services/Form/FormErrorService';
7
7
  import { isEqual } from 'lodash';
8
+ import { transformErrorToMessage } from '@licklist/plugins';
8
9
  import { Dialog } from '../../modals/dialog/Dialog.js';
9
10
  import { useDialogContext } from '../../modals/dialog/DialogContext.js';
10
11
  import { ProductSetControl } from '../control/ProductSetControl.js';
@@ -142,6 +143,13 @@ function ProductSetForm(_param) {
142
143
  if (!serverErrors) {
143
144
  return;
144
145
  }
146
+ if (!Array.isArray(serverErrors)) {
147
+ setErrorMessage(transformErrorToMessage(serverErrors));
148
+ return;
149
+ }
150
+ if (Array.isArray(serverErrors) && serverErrors[0]) {
151
+ setErrorMessage(serverErrors[0]);
152
+ }
145
153
  FormErrorService.handleServerErrors(serverErrors, setError);
146
154
  }, [
147
155
  serverErrors,
@@ -0,0 +1,6 @@
1
+ export declare const ProductSetNameControl: ({ value, onChange, error, }: {
2
+ value: string;
3
+ onChange: (value: string) => void;
4
+ error?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=ProductSetNameControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductSetNameControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/ProductSetNameControl.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,gCAI/B;IACD,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,4CAeA,CAAA"}
@@ -0,0 +1,35 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Form } from 'react-bootstrap';
3
+ import { useTranslation } from 'react-i18next';
4
+
5
+ var ProductSetNameControl = function(param) {
6
+ var value = param.value, onChange = param.onChange, error = param.error;
7
+ var t = useTranslation([
8
+ 'Design'
9
+ ]).t;
10
+ return /*#__PURE__*/ jsxs(Form.Group, {
11
+ children: [
12
+ /*#__PURE__*/ jsxs(Form.Label, {
13
+ children: [
14
+ t('Design:ProductSetName'),
15
+ "*"
16
+ ]
17
+ }),
18
+ /*#__PURE__*/ jsx(Form.Control, {
19
+ value: value,
20
+ maxLength: 255,
21
+ onChange: function(e) {
22
+ return onChange(e.target.value);
23
+ },
24
+ placeholder: t('Design:placeholderProductSetName'),
25
+ isInvalid: Boolean(error)
26
+ }),
27
+ /*#__PURE__*/ jsx(Form.Control.Feedback, {
28
+ type: "invalid",
29
+ children: error
30
+ })
31
+ ]
32
+ });
33
+ };
34
+
35
+ export { ProductSetNameControl };
@@ -1,2 +1,3 @@
1
1
  export * from './ProductSetForm';
2
+ export * from './ProductSetNameControl';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA"}
@@ -2,6 +2,7 @@ import { EmailTemplate } from '@licklist/core/dist/DataMapper/Notification/Email
2
2
  import { SmsTemplate } from '@licklist/core/dist/DataMapper/Notification/SmsTemplateDataMapper';
3
3
  import { TFunction } from 'react-i18next';
4
4
  import { UseFormSetError } from 'react-hook-form';
5
+ import { ProductSet } from '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper';
5
6
  import { TemplateItem } from '../control/ProductSetControl';
6
7
  import { ProductSetFormValues } from '../form/ProductSetForm';
7
8
  interface CheckAvailableTimesErrors {
@@ -9,11 +10,17 @@ interface CheckAvailableTimesErrors {
9
10
  setError: UseFormSetError<ProductSetFormValues>;
10
11
  t: TFunction;
11
12
  }
13
+ export interface MenuTypeheadItem {
14
+ id: number;
15
+ label: string;
16
+ value: number;
17
+ }
12
18
  export declare const moveArrayElements: <T>(array: T[], prevIndex: number, nextIndex: number) => T[];
13
19
  export declare const sortArrayByIndex: <T>(array: T[]) => (T & {
14
20
  sort: number;
15
21
  })[];
16
22
  export declare const getFilteredTemplates: (templates?: EmailTemplate[] | SmsTemplate[], formTemplates?: TemplateItem[]) => TemplateItem[] | undefined;
17
23
  export declare const checkAvailableTimesErrors: ({ values, setError, t, }: CheckAvailableTimesErrors) => boolean;
24
+ export declare const getTypeHeadItemsFromMenus: (menus?: (ProductSet | ProductSetFormValues)[]) => MenuTypeheadItem[];
18
25
  export {};
19
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/product-set/utils/index.ts"],"names":[],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AAE7D,UAAU,yBAAyB;IACjC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,QAAQ,EAAE,eAAe,CAAC,oBAAoB,CAAC,CAAA;IAC/C,CAAC,EAAE,SAAS,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AACD,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAC1B,CAAC,EAAE,aACC,MAAM,aACN,MAAM,QAQlB,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,CAAC,EAAE;;IACmB,CAAA;AAEjE,eAAO,MAAM,oBAAoB,eACnB,aAAa,EAAE,GAAG,WAAW,EAAE,kBAC3B,YAAY,EAAE,KAC7B,YAAY,EAAE,GAAG,SAmBnB,CAAA;AAED,eAAO,MAAM,yBAAyB,6BAInC,yBAAyB,YA0B3B,CAAA;AAED,eAAO,MAAM,yBAAyB,WAC5B,CAAC,UAAU,GAAG,oBAAoB,CAAC,EAAE,KAC5C,gBAAgB,EACwD,CAAA"}
@@ -136,5 +136,14 @@ var checkAvailableTimesErrors = function(param) {
136
136
  });
137
137
  return hasError;
138
138
  };
139
+ var getTypeHeadItemsFromMenus = function(menus) {
140
+ return menus === null || menus === void 0 ? void 0 : menus.map(function(menu) {
141
+ return {
142
+ id: menu.id,
143
+ value: menu.id,
144
+ label: menu.name
145
+ };
146
+ });
147
+ };
139
148
 
140
- export { checkAvailableTimesErrors, getFilteredTemplates, moveArrayElements, sortArrayByIndex };
149
+ export { checkAvailableTimesErrors, getFilteredTemplates, getTypeHeadItemsFromMenus, moveArrayElements, sortArrayByIndex };
@@ -11,10 +11,7 @@
11
11
  background-color: #fff;
12
12
  font-size: 0.8rem;
13
13
  background-color: $snippet-product-set-background-color;
14
-
15
- div {
16
- text-align: left;
17
- }
14
+ text-align: left;
18
15
 
19
16
  &.active {
20
17
  border: 2px solid #0e8be1;
@@ -23,7 +20,24 @@
23
20
  &-title {
24
21
  font-weight: 600;
25
22
  line-height: 1.25rem;
26
- cursor: pointer;
27
23
  font-size: 0.875rem;
28
24
  }
25
+
26
+ img {
27
+ max-height: 100%;
28
+ max-width: 100%;
29
+ object-fit: cover;
30
+ aspect-ratio: 1.2/1;
31
+ margin-bottom: 0.8rem;
32
+ border-radius: 0.5rem;
33
+ }
34
+
35
+ &-description {
36
+ line-clamp: 5;
37
+ -webkit-line-clamp: 5;
38
+ overflow: hidden;
39
+ text-overflow: ellipsis;
40
+ display: -webkit-box;
41
+ -webkit-box-orient: vertical;
42
+ }
29
43
  }
@@ -3,56 +3,26 @@
3
3
  .list-activity-card {
4
4
  display: flex;
5
5
  justify-content: space-between;
6
- align-items: center;
7
- cursor: pointer;
8
- height: 6rem;
9
- padding: 0.375rem;
10
- border: 2px solid transparent;
11
- border-radius: 0.5rem;
12
- background-color: $snippet-product-set-background-color;
13
- color: $snippet-product-set-font-color;
14
- transition: $color-transition;
6
+ gap: 0.5rem;
7
+ width: 100%;
15
8
 
16
- &.active {
17
- border: 2px solid #0e8be1;
18
- }
19
-
20
- p {
21
- margin-bottom: 0;
22
- }
23
-
24
- .description {
9
+ &-info {
25
10
  width: 70%;
26
11
  font-size: 0.81rem;
27
12
  display: flex;
28
13
  flex-direction: column;
14
+ align-items: start;
29
15
  }
30
16
 
31
- .title {
32
- font-weight: 600;
33
- font-size: 0.875rem;
34
- line-height: 1.5rem;
35
- }
36
-
37
- .image-container {
38
- display: flex;
39
- justify-content: start;
17
+ img {
18
+ max-width: 120px;
40
19
  height: 100%;
41
-
42
- .image {
43
- display: flex;
44
- align-items: start;
45
- width: 7rem;
46
- height: 4rem;
47
- margin-left: 3rem;
48
- background-repeat: no-repeat;
49
- background-size: cover;
50
- background-position: center;
51
- border-radius: 0.5rem;
52
- }
20
+ object-fit: cover;
21
+ aspect-ratio: 1.2/1;
22
+ border-radius: 0.5rem;
53
23
  }
54
- }
55
24
 
56
- .list-activity-card-hr {
57
- margin-top: 0;
25
+ &-hr {
26
+ margin-top: 0;
27
+ }
58
28
  }
@@ -1,2 +1,2 @@
1
- @import './GridActivitiesCard.scss';
1
+ @import './ActivitiesCard.scss';
2
2
  @import './ListActivitiesCard.scss';
@@ -1,3 +1,4 @@
1
+ import { CSSObjectWithLabel } from 'react-select';
1
2
  export type TypeaheadOptions = {
2
3
  id: number | string;
3
4
  value: any;
@@ -8,11 +9,14 @@ export interface TypeaheadProps {
8
9
  placeholder: string;
9
10
  isRequired?: boolean;
10
11
  name: string;
12
+ value?: TypeaheadOptions;
11
13
  isMultipleChoise?: boolean;
12
14
  noOptionsMessage: string;
13
15
  isInvalid?: boolean;
14
16
  isCouponForm?: boolean;
17
+ containerStyles?: CSSObjectWithLabel;
18
+ onChangeValue?: (value: TypeaheadOptions) => void;
15
19
  }
16
- declare function Typeahead({ options, placeholder, isRequired, isMultipleChoise, name, isCouponForm, noOptionsMessage, isInvalid, }: TypeaheadProps): import("react/jsx-runtime").JSX.Element;
20
+ declare function Typeahead({ options, placeholder, isRequired, isMultipleChoise, name, value, onChangeValue, containerStyles, isCouponForm, noOptionsMessage, isInvalid, }: TypeaheadProps): import("react/jsx-runtime").JSX.Element;
17
21
  export { Typeahead };
18
22
  //# sourceMappingURL=Typeahead.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../src/typeahead/Typeahead.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,KAAK,EAAE,GAAG,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB,CAAC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oDhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -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, _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;
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, value = param.value, onChangeValue = param.onChangeValue, containerStyles = param.containerStyles, _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,14 +53,21 @@ function Typeahead(param) {
53
53
  var field = param.field;
54
54
  return /*#__PURE__*/ jsx(Select, {
55
55
  placeholder: placeholder,
56
- value: field.value,
56
+ value: value !== null && value !== void 0 ? value : field.value,
57
57
  isMulti: isMultipleChoise,
58
58
  styles: {
59
+ container: function(base) {
60
+ return _object_spread({}, base, containerStyles);
61
+ },
59
62
  control: function(base) {
60
63
  return _object_spread({}, base, getStyle());
61
64
  }
62
65
  },
63
66
  onChange: function(value) {
67
+ if (onChangeValue) {
68
+ onChangeValue(value);
69
+ return;
70
+ }
64
71
  field.onChange(value);
65
72
  },
66
73
  options: options,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.69.3",
3
+ "version": "0.69.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -44,7 +44,7 @@
44
44
  "peerDependencies": {
45
45
  "@licklist/core": "0.30.3",
46
46
  "@licklist/eslint-config": "0.5.6",
47
- "@licklist/plugins": "0.33.1",
47
+ "@licklist/plugins": "0.33.4",
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.30.1",
64
+ "@licklist/core": "0.30.3",
65
65
  "@licklist/eslint-config": "0.5.6",
66
- "@licklist/plugins": "0.33.1",
66
+ "@licklist/plugins": "0.33.4",
67
67
  "@mantine/core": "6.0.22",
68
68
  "@mantine/hooks": "6.0.22",
69
69
  "@mdx-js/react": "1.6.22",
@@ -206,4 +206,4 @@
206
206
  "node": "20.9.0",
207
207
  "yarn": "4.4.0"
208
208
  }
209
- }
209
+ }
@@ -64,6 +64,7 @@ export interface EditEventFormProps extends HasPermissionProp {
64
64
  isExternalPaymentLinkEnabled?: boolean
65
65
  timeZone: string
66
66
  eventProductSet?: ProductSet
67
+ overrideNameError?: string
67
68
  }
68
69
 
69
70
  const eventImageTypes = {
@@ -85,6 +86,7 @@ export const EditEventForm = ({
85
86
  isExternalPaymentLinkEnabled,
86
87
  timeZone,
87
88
  eventProductSet,
89
+ overrideNameError,
88
90
  }: EditEventFormProps) => {
89
91
  const { t } = useTranslation(['Design', 'Validation'])
90
92
 
@@ -406,6 +408,7 @@ export const EditEventForm = ({
406
408
  showEditProductSet={showEditProductSet}
407
409
  timeZone={timeZone}
408
410
  eventProductSet={eventProductSet}
411
+ overrideNameError={overrideNameError}
409
412
  />
410
413
 
411
414
  {hasPermission && !showEditProductSet && (