@knovator/pagecreator-admin 1.5.3 → 1.5.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.
- package/index.cjs +28 -8
- package/index.js +28 -8
- package/package.json +1 -1
- package/src/lib/types/components.d.ts +2 -2
package/index.cjs
CHANGED
|
@@ -3440,6 +3440,7 @@ const CustomReactSelect = ({
|
|
|
3440
3440
|
customStyles,
|
|
3441
3441
|
selectKey
|
|
3442
3442
|
}) => {
|
|
3443
|
+
console.log('selectedOptions: ', _selectedOptions);
|
|
3443
3444
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3444
3445
|
className: wrapperClassName
|
|
3445
3446
|
}, label && (/*#__PURE__*/React__default["default"].createElement("label", {
|
|
@@ -3460,7 +3461,7 @@ const CustomReactSelect = ({
|
|
|
3460
3461
|
isLoading: isLoading,
|
|
3461
3462
|
loadOptions: loadOptions,
|
|
3462
3463
|
placeholder: placeholder,
|
|
3463
|
-
formatOptionLabel: formatOptionLabel ? option => formatOptionLabel(listCode, option) : undefined,
|
|
3464
|
+
formatOptionLabel: formatOptionLabel && listCode !== 'pages' ? option => formatOptionLabel(listCode, option) : undefined,
|
|
3464
3465
|
styles: customStyles
|
|
3465
3466
|
}), error && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
3466
3467
|
className: "khb_input-error "
|
|
@@ -4028,6 +4029,7 @@ const DNDItemsList = ({
|
|
|
4028
4029
|
onFilterClick,
|
|
4029
4030
|
disableSettings: _disableSettings = false
|
|
4030
4031
|
}) => {
|
|
4032
|
+
console.log('items: ', items);
|
|
4031
4033
|
return /*#__PURE__*/React__default["default"].createElement(DragDropContextWrapper, {
|
|
4032
4034
|
onDragEnd: onDragEnd
|
|
4033
4035
|
}, /*#__PURE__*/React__default["default"].createElement(DroppableWrapper, {
|
|
@@ -4043,7 +4045,7 @@ const DNDItemsList = ({
|
|
|
4043
4045
|
className: "khb_DND-item",
|
|
4044
4046
|
key: item.value,
|
|
4045
4047
|
ref: provided.innerRef
|
|
4046
|
-
}, provided.draggableProps, provided.dragHandleProps), typeof formatItem === 'function' && listCode ? formatItem(listCode, item) : (/*#__PURE__*/React__default["default"].createElement("div", {
|
|
4048
|
+
}, provided.draggableProps, provided.dragHandleProps), typeof formatItem === 'function' && listCode && listCode !== 'pages' ? formatItem(listCode, item) : (/*#__PURE__*/React__default["default"].createElement("div", {
|
|
4047
4049
|
className: "khb_DND-item-content"
|
|
4048
4050
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
4049
4051
|
className: "khb_DND-item-text"
|
|
@@ -7118,6 +7120,8 @@ const constants = {
|
|
|
7118
7120
|
imageItemsTypeValue: 'Image',
|
|
7119
7121
|
textWidgetTypeValue: 'Text',
|
|
7120
7122
|
htmlWidgetTypeValue: 'HTML',
|
|
7123
|
+
linksWidgetTypeValue: 'Links',
|
|
7124
|
+
pagesItemsTypeValue: 'pages',
|
|
7121
7125
|
tabsAccessor: 'tabs',
|
|
7122
7126
|
webItems: 'webItems',
|
|
7123
7127
|
mobileItems: 'mobileItems',
|
|
@@ -7186,7 +7190,7 @@ const WidgetForm = ({
|
|
|
7186
7190
|
if ((data === null || data === void 0 ? void 0 : data.collectionName) !== constants.imageItemsTypeValue && itemsTypes && itemsTypes.length > 0) {
|
|
7187
7191
|
setSelectedCollectionType(itemsTypes.find(item => item.value === (data === null || data === void 0 ? void 0 : data.collectionName)));
|
|
7188
7192
|
}
|
|
7189
|
-
if ((data === null || data === void 0 ? void 0 : data.widgetType) === constants.textWidgetTypeValue || (data === null || data === void 0 ? void 0 : data.widgetType) === constants.htmlWidgetTypeValue) {
|
|
7193
|
+
if ((data === null || data === void 0 ? void 0 : data.widgetType) === constants.textWidgetTypeValue || (data === null || data === void 0 ? void 0 : data.widgetType) === constants.htmlWidgetTypeValue || (data === null || data === void 0 ? void 0 : data.widgetType) === constants.linksWidgetTypeValue) {
|
|
7190
7194
|
setItemsEnabled(false);
|
|
7191
7195
|
}
|
|
7192
7196
|
}
|
|
@@ -7203,7 +7207,7 @@ const WidgetForm = ({
|
|
|
7203
7207
|
reset(data);
|
|
7204
7208
|
}
|
|
7205
7209
|
}, [data, reset]);
|
|
7206
|
-
const onChangeSearch = (str, callback) => {
|
|
7210
|
+
const onChangeSearch = (str, callback, collectionName) => {
|
|
7207
7211
|
let collectionItems = [];
|
|
7208
7212
|
let valueToSet = '';
|
|
7209
7213
|
if (formState === 'UPDATE') {
|
|
@@ -7220,13 +7224,17 @@ const WidgetForm = ({
|
|
|
7220
7224
|
}
|
|
7221
7225
|
if (callerRef.current) clearTimeout(callerRef.current);
|
|
7222
7226
|
let item;
|
|
7227
|
+
// Use passed collectionName or fall back to selectedCollectionType
|
|
7228
|
+
const collectionToUse = collectionName || (selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value);
|
|
7223
7229
|
callerRef.current = setTimeout(() => {
|
|
7224
|
-
if (
|
|
7230
|
+
if (collectionToUse) getCollectionData(collectionToUse, str, options => {
|
|
7231
|
+
console.log('API options:', options); // Debug: see what comes from backend
|
|
7225
7232
|
if (typeof callback === 'function') callback(options.map(item => Object.assign({
|
|
7226
7233
|
value: item['_id'] || item['id'],
|
|
7227
7234
|
label: item['name']
|
|
7228
7235
|
}, item)));
|
|
7229
7236
|
if (formState === 'UPDATE') {
|
|
7237
|
+
console.log('collectionItems (stored IDs):', collectionItems); // Debug
|
|
7230
7238
|
let selectedOptions = (collectionItems === null || collectionItems === void 0 ? void 0 : collectionItems.map(itemId => {
|
|
7231
7239
|
item = options.find(item => item._id === itemId || item.id === itemId);
|
|
7232
7240
|
return item ? Object.assign({
|
|
@@ -7235,6 +7243,7 @@ const WidgetForm = ({
|
|
|
7235
7243
|
}, item) : {};
|
|
7236
7244
|
})) || [];
|
|
7237
7245
|
selectedOptions = selectedOptions.filter(obj => !!obj.value);
|
|
7246
|
+
console.log('selectedOptions (after mapping):', selectedOptions); // Debug
|
|
7238
7247
|
if (valueToSet) {
|
|
7239
7248
|
// only set tabcollection items, when they are not set
|
|
7240
7249
|
if (!tabCollectionItemsUpdated[activeTab]) {
|
|
@@ -7276,6 +7285,12 @@ const WidgetForm = ({
|
|
|
7276
7285
|
setSelectedWidgetType(widgetType);
|
|
7277
7286
|
if ((widgetType === null || widgetType === void 0 ? void 0 : widgetType.value) === constants.textWidgetTypeValue || (widgetType === null || widgetType === void 0 ? void 0 : widgetType.value) === constants.htmlWidgetTypeValue) {
|
|
7278
7287
|
setItemsEnabled(false);
|
|
7288
|
+
} else if ((widgetType === null || widgetType === void 0 ? void 0 : widgetType.value) === constants.linksWidgetTypeValue) {
|
|
7289
|
+
setItemsEnabled(false);
|
|
7290
|
+
setValue(constants.itemTypeAccessor, constants.pagesItemsTypeValue);
|
|
7291
|
+
setValue(constants.collectionNameAccessor, constants.pagesItemsTypeValue);
|
|
7292
|
+
const pagesOption = itemsTypes.find(item => item.value === constants.pagesItemsTypeValue);
|
|
7293
|
+
if (pagesOption) setSelectedCollectionType(pagesOption);
|
|
7279
7294
|
} else {
|
|
7280
7295
|
setItemsEnabled(true);
|
|
7281
7296
|
}
|
|
@@ -7352,8 +7367,13 @@ const WidgetForm = ({
|
|
|
7352
7367
|
if (!formData[constants.itemTypeAccessor] && formState === 'ADD') {
|
|
7353
7368
|
formData[constants.itemTypeAccessor] = (_a = getFirstItemTypeValue(formData[constants.widgetTypeAccessor])) === null || _a === void 0 ? void 0 : _a.value;
|
|
7354
7369
|
}
|
|
7370
|
+
// Force collectionName and itemsType for Links widget
|
|
7371
|
+
if (formData[constants.widgetTypeAccessor] === constants.linksWidgetTypeValue) {
|
|
7372
|
+
formData[constants.collectionNameAccessor] = constants.pagesItemsTypeValue;
|
|
7373
|
+
formData[constants.itemTypeAccessor] = constants.pagesItemsTypeValue;
|
|
7374
|
+
}
|
|
7355
7375
|
// setting collectionName if widgetType is FixedCard or Carousel and FormState
|
|
7356
|
-
if (formData[constants.itemTypeAccessor] !== constants.imageItemsTypeValue && formState === 'ADD') {
|
|
7376
|
+
else if (formData[constants.itemTypeAccessor] !== constants.imageItemsTypeValue && formState === 'ADD') {
|
|
7357
7377
|
formData[constants.collectionNameAccessor] = selectedCollectionType ? selectedCollectionType.value : (_b = getFirstItemTypeValue(formData[constants.widgetTypeAccessor])) === null || _b === void 0 ? void 0 : _b.value;
|
|
7358
7378
|
}
|
|
7359
7379
|
// setting colleciton items if collectionItems are there
|
|
@@ -7510,7 +7530,7 @@ const WidgetForm = ({
|
|
|
7510
7530
|
validations: {
|
|
7511
7531
|
required: widgetTranslations.itemsTypePlaceholder
|
|
7512
7532
|
},
|
|
7513
|
-
options: (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.tabsWidgetTypeValue || (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.collectionsOnly) ? itemsTypes.filter(item => item.label !== constants.imageItemsTypeValue) : (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.imageOnly) ? itemsTypes.filter(item => item.label === constants.imageItemsTypeValue) : itemsTypes
|
|
7533
|
+
options: (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.linksWidgetTypeValue ? itemsTypes.filter(item => item.value === constants.pagesItemsTypeValue) : (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.tabsWidgetTypeValue || (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.collectionsOnly) ? itemsTypes.filter(item => item.label !== constants.imageItemsTypeValue && item.value !== constants.pagesItemsTypeValue) : (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.imageOnly) ? itemsTypes.filter(item => item.label === constants.imageItemsTypeValue) : itemsTypes.filter(item => item.value !== constants.pagesItemsTypeValue)
|
|
7514
7534
|
}, {
|
|
7515
7535
|
label: widgetTranslations.color,
|
|
7516
7536
|
accessor: 'backgroundColor',
|
|
@@ -7573,7 +7593,7 @@ const WidgetForm = ({
|
|
|
7573
7593
|
onChange: setSelectedCollectionItems,
|
|
7574
7594
|
loadOptions: onChangeSearch,
|
|
7575
7595
|
isLoading: collectionDataLoading,
|
|
7576
|
-
show: !itemsEnabled && ((selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.carouselWidgetTypeValue || (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.fixedCardWidgetTypeValue || !selectedWidgetType) && !!(selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value),
|
|
7596
|
+
show: !itemsEnabled && ((selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.carouselWidgetTypeValue || (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.fixedCardWidgetTypeValue || (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.linksWidgetTypeValue || !selectedWidgetType) && !!(selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value),
|
|
7577
7597
|
formatOptionLabel: formatOptionLabel,
|
|
7578
7598
|
listCode: selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value,
|
|
7579
7599
|
customStyles: reactSelectStyles || {},
|
package/index.js
CHANGED
|
@@ -3428,6 +3428,7 @@ const CustomReactSelect = ({
|
|
|
3428
3428
|
customStyles,
|
|
3429
3429
|
selectKey
|
|
3430
3430
|
}) => {
|
|
3431
|
+
console.log('selectedOptions: ', _selectedOptions);
|
|
3431
3432
|
return /*#__PURE__*/React.createElement("div", {
|
|
3432
3433
|
className: wrapperClassName
|
|
3433
3434
|
}, label && (/*#__PURE__*/React.createElement("label", {
|
|
@@ -3448,7 +3449,7 @@ const CustomReactSelect = ({
|
|
|
3448
3449
|
isLoading: isLoading,
|
|
3449
3450
|
loadOptions: loadOptions,
|
|
3450
3451
|
placeholder: placeholder,
|
|
3451
|
-
formatOptionLabel: formatOptionLabel ? option => formatOptionLabel(listCode, option) : undefined,
|
|
3452
|
+
formatOptionLabel: formatOptionLabel && listCode !== 'pages' ? option => formatOptionLabel(listCode, option) : undefined,
|
|
3452
3453
|
styles: customStyles
|
|
3453
3454
|
}), error && /*#__PURE__*/React.createElement("p", {
|
|
3454
3455
|
className: "khb_input-error "
|
|
@@ -4016,6 +4017,7 @@ const DNDItemsList = ({
|
|
|
4016
4017
|
onFilterClick,
|
|
4017
4018
|
disableSettings: _disableSettings = false
|
|
4018
4019
|
}) => {
|
|
4020
|
+
console.log('items: ', items);
|
|
4019
4021
|
return /*#__PURE__*/React.createElement(DragDropContextWrapper, {
|
|
4020
4022
|
onDragEnd: onDragEnd
|
|
4021
4023
|
}, /*#__PURE__*/React.createElement(DroppableWrapper, {
|
|
@@ -4031,7 +4033,7 @@ const DNDItemsList = ({
|
|
|
4031
4033
|
className: "khb_DND-item",
|
|
4032
4034
|
key: item.value,
|
|
4033
4035
|
ref: provided.innerRef
|
|
4034
|
-
}, provided.draggableProps, provided.dragHandleProps), typeof formatItem === 'function' && listCode ? formatItem(listCode, item) : (/*#__PURE__*/React.createElement("div", {
|
|
4036
|
+
}, provided.draggableProps, provided.dragHandleProps), typeof formatItem === 'function' && listCode && listCode !== 'pages' ? formatItem(listCode, item) : (/*#__PURE__*/React.createElement("div", {
|
|
4035
4037
|
className: "khb_DND-item-content"
|
|
4036
4038
|
}, /*#__PURE__*/React.createElement("p", {
|
|
4037
4039
|
className: "khb_DND-item-text"
|
|
@@ -7106,6 +7108,8 @@ const constants = {
|
|
|
7106
7108
|
imageItemsTypeValue: 'Image',
|
|
7107
7109
|
textWidgetTypeValue: 'Text',
|
|
7108
7110
|
htmlWidgetTypeValue: 'HTML',
|
|
7111
|
+
linksWidgetTypeValue: 'Links',
|
|
7112
|
+
pagesItemsTypeValue: 'pages',
|
|
7109
7113
|
tabsAccessor: 'tabs',
|
|
7110
7114
|
webItems: 'webItems',
|
|
7111
7115
|
mobileItems: 'mobileItems',
|
|
@@ -7174,7 +7178,7 @@ const WidgetForm = ({
|
|
|
7174
7178
|
if ((data === null || data === void 0 ? void 0 : data.collectionName) !== constants.imageItemsTypeValue && itemsTypes && itemsTypes.length > 0) {
|
|
7175
7179
|
setSelectedCollectionType(itemsTypes.find(item => item.value === (data === null || data === void 0 ? void 0 : data.collectionName)));
|
|
7176
7180
|
}
|
|
7177
|
-
if ((data === null || data === void 0 ? void 0 : data.widgetType) === constants.textWidgetTypeValue || (data === null || data === void 0 ? void 0 : data.widgetType) === constants.htmlWidgetTypeValue) {
|
|
7181
|
+
if ((data === null || data === void 0 ? void 0 : data.widgetType) === constants.textWidgetTypeValue || (data === null || data === void 0 ? void 0 : data.widgetType) === constants.htmlWidgetTypeValue || (data === null || data === void 0 ? void 0 : data.widgetType) === constants.linksWidgetTypeValue) {
|
|
7178
7182
|
setItemsEnabled(false);
|
|
7179
7183
|
}
|
|
7180
7184
|
}
|
|
@@ -7191,7 +7195,7 @@ const WidgetForm = ({
|
|
|
7191
7195
|
reset(data);
|
|
7192
7196
|
}
|
|
7193
7197
|
}, [data, reset]);
|
|
7194
|
-
const onChangeSearch = (str, callback) => {
|
|
7198
|
+
const onChangeSearch = (str, callback, collectionName) => {
|
|
7195
7199
|
let collectionItems = [];
|
|
7196
7200
|
let valueToSet = '';
|
|
7197
7201
|
if (formState === 'UPDATE') {
|
|
@@ -7208,13 +7212,17 @@ const WidgetForm = ({
|
|
|
7208
7212
|
}
|
|
7209
7213
|
if (callerRef.current) clearTimeout(callerRef.current);
|
|
7210
7214
|
let item;
|
|
7215
|
+
// Use passed collectionName or fall back to selectedCollectionType
|
|
7216
|
+
const collectionToUse = collectionName || (selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value);
|
|
7211
7217
|
callerRef.current = setTimeout(() => {
|
|
7212
|
-
if (
|
|
7218
|
+
if (collectionToUse) getCollectionData(collectionToUse, str, options => {
|
|
7219
|
+
console.log('API options:', options); // Debug: see what comes from backend
|
|
7213
7220
|
if (typeof callback === 'function') callback(options.map(item => Object.assign({
|
|
7214
7221
|
value: item['_id'] || item['id'],
|
|
7215
7222
|
label: item['name']
|
|
7216
7223
|
}, item)));
|
|
7217
7224
|
if (formState === 'UPDATE') {
|
|
7225
|
+
console.log('collectionItems (stored IDs):', collectionItems); // Debug
|
|
7218
7226
|
let selectedOptions = (collectionItems === null || collectionItems === void 0 ? void 0 : collectionItems.map(itemId => {
|
|
7219
7227
|
item = options.find(item => item._id === itemId || item.id === itemId);
|
|
7220
7228
|
return item ? Object.assign({
|
|
@@ -7223,6 +7231,7 @@ const WidgetForm = ({
|
|
|
7223
7231
|
}, item) : {};
|
|
7224
7232
|
})) || [];
|
|
7225
7233
|
selectedOptions = selectedOptions.filter(obj => !!obj.value);
|
|
7234
|
+
console.log('selectedOptions (after mapping):', selectedOptions); // Debug
|
|
7226
7235
|
if (valueToSet) {
|
|
7227
7236
|
// only set tabcollection items, when they are not set
|
|
7228
7237
|
if (!tabCollectionItemsUpdated[activeTab]) {
|
|
@@ -7264,6 +7273,12 @@ const WidgetForm = ({
|
|
|
7264
7273
|
setSelectedWidgetType(widgetType);
|
|
7265
7274
|
if ((widgetType === null || widgetType === void 0 ? void 0 : widgetType.value) === constants.textWidgetTypeValue || (widgetType === null || widgetType === void 0 ? void 0 : widgetType.value) === constants.htmlWidgetTypeValue) {
|
|
7266
7275
|
setItemsEnabled(false);
|
|
7276
|
+
} else if ((widgetType === null || widgetType === void 0 ? void 0 : widgetType.value) === constants.linksWidgetTypeValue) {
|
|
7277
|
+
setItemsEnabled(false);
|
|
7278
|
+
setValue(constants.itemTypeAccessor, constants.pagesItemsTypeValue);
|
|
7279
|
+
setValue(constants.collectionNameAccessor, constants.pagesItemsTypeValue);
|
|
7280
|
+
const pagesOption = itemsTypes.find(item => item.value === constants.pagesItemsTypeValue);
|
|
7281
|
+
if (pagesOption) setSelectedCollectionType(pagesOption);
|
|
7267
7282
|
} else {
|
|
7268
7283
|
setItemsEnabled(true);
|
|
7269
7284
|
}
|
|
@@ -7340,8 +7355,13 @@ const WidgetForm = ({
|
|
|
7340
7355
|
if (!formData[constants.itemTypeAccessor] && formState === 'ADD') {
|
|
7341
7356
|
formData[constants.itemTypeAccessor] = (_a = getFirstItemTypeValue(formData[constants.widgetTypeAccessor])) === null || _a === void 0 ? void 0 : _a.value;
|
|
7342
7357
|
}
|
|
7358
|
+
// Force collectionName and itemsType for Links widget
|
|
7359
|
+
if (formData[constants.widgetTypeAccessor] === constants.linksWidgetTypeValue) {
|
|
7360
|
+
formData[constants.collectionNameAccessor] = constants.pagesItemsTypeValue;
|
|
7361
|
+
formData[constants.itemTypeAccessor] = constants.pagesItemsTypeValue;
|
|
7362
|
+
}
|
|
7343
7363
|
// setting collectionName if widgetType is FixedCard or Carousel and FormState
|
|
7344
|
-
if (formData[constants.itemTypeAccessor] !== constants.imageItemsTypeValue && formState === 'ADD') {
|
|
7364
|
+
else if (formData[constants.itemTypeAccessor] !== constants.imageItemsTypeValue && formState === 'ADD') {
|
|
7345
7365
|
formData[constants.collectionNameAccessor] = selectedCollectionType ? selectedCollectionType.value : (_b = getFirstItemTypeValue(formData[constants.widgetTypeAccessor])) === null || _b === void 0 ? void 0 : _b.value;
|
|
7346
7366
|
}
|
|
7347
7367
|
// setting colleciton items if collectionItems are there
|
|
@@ -7498,7 +7518,7 @@ const WidgetForm = ({
|
|
|
7498
7518
|
validations: {
|
|
7499
7519
|
required: widgetTranslations.itemsTypePlaceholder
|
|
7500
7520
|
},
|
|
7501
|
-
options: (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.tabsWidgetTypeValue || (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.collectionsOnly) ? itemsTypes.filter(item => item.label !== constants.imageItemsTypeValue) : (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.imageOnly) ? itemsTypes.filter(item => item.label === constants.imageItemsTypeValue) : itemsTypes
|
|
7521
|
+
options: (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.linksWidgetTypeValue ? itemsTypes.filter(item => item.value === constants.pagesItemsTypeValue) : (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.tabsWidgetTypeValue || (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.collectionsOnly) ? itemsTypes.filter(item => item.label !== constants.imageItemsTypeValue && item.value !== constants.pagesItemsTypeValue) : (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.imageOnly) ? itemsTypes.filter(item => item.label === constants.imageItemsTypeValue) : itemsTypes.filter(item => item.value !== constants.pagesItemsTypeValue)
|
|
7502
7522
|
}, {
|
|
7503
7523
|
label: widgetTranslations.color,
|
|
7504
7524
|
accessor: 'backgroundColor',
|
|
@@ -7561,7 +7581,7 @@ const WidgetForm = ({
|
|
|
7561
7581
|
onChange: setSelectedCollectionItems,
|
|
7562
7582
|
loadOptions: onChangeSearch,
|
|
7563
7583
|
isLoading: collectionDataLoading,
|
|
7564
|
-
show: !itemsEnabled && ((selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.carouselWidgetTypeValue || (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.fixedCardWidgetTypeValue || !selectedWidgetType) && !!(selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value),
|
|
7584
|
+
show: !itemsEnabled && ((selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.carouselWidgetTypeValue || (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.fixedCardWidgetTypeValue || (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) === constants.linksWidgetTypeValue || !selectedWidgetType) && !!(selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value),
|
|
7565
7585
|
formatOptionLabel: formatOptionLabel,
|
|
7566
7586
|
listCode: selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value,
|
|
7567
7587
|
customStyles: reactSelectStyles || {},
|
package/package.json
CHANGED
|
@@ -126,7 +126,7 @@ export interface ReactSelectProps {
|
|
|
126
126
|
listCode?: string;
|
|
127
127
|
wrapperClassName?: string;
|
|
128
128
|
customStyles?: any;
|
|
129
|
-
loadOptions?: (value?: string, callback?: (options: OptionType[]) => void) => Promise<OptionType[]
|
|
129
|
+
loadOptions?: (value?: string, callback?: (options: OptionType[]) => void, collectionName?: string) => Promise<OptionType[]> | void;
|
|
130
130
|
selectKey?: string;
|
|
131
131
|
}
|
|
132
132
|
export interface CustomInputType {
|
|
@@ -349,7 +349,7 @@ export interface TabsProps {
|
|
|
349
349
|
getValues: UseFormGetValues<FieldValues>;
|
|
350
350
|
setValue: UseFormSetValue<FieldValues>;
|
|
351
351
|
languages?: LanguageType[];
|
|
352
|
-
loadOptions?: (value?: string, callback?: (options: OptionType[]) => void) => Promise<OptionType[]
|
|
352
|
+
loadOptions?: (value?: string, callback?: (options: OptionType[]) => void, collectionName?: string) => Promise<OptionType[]> | void;
|
|
353
353
|
}
|
|
354
354
|
export interface ImageUploadProps {
|
|
355
355
|
className?: string;
|