@knovator/pagecreator-admin 1.5.4 → 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 +6 -2
- package/index.js +6 -2
- package/package.json +1 -1
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 "
|
|
@@ -4044,7 +4045,7 @@ const DNDItemsList = ({
|
|
|
4044
4045
|
className: "khb_DND-item",
|
|
4045
4046
|
key: item.value,
|
|
4046
4047
|
ref: provided.innerRef
|
|
4047
|
-
}, 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", {
|
|
4048
4049
|
className: "khb_DND-item-content"
|
|
4049
4050
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
4050
4051
|
className: "khb_DND-item-text"
|
|
@@ -7227,11 +7228,13 @@ const WidgetForm = ({
|
|
|
7227
7228
|
const collectionToUse = collectionName || (selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value);
|
|
7228
7229
|
callerRef.current = setTimeout(() => {
|
|
7229
7230
|
if (collectionToUse) getCollectionData(collectionToUse, str, options => {
|
|
7231
|
+
console.log('API options:', options); // Debug: see what comes from backend
|
|
7230
7232
|
if (typeof callback === 'function') callback(options.map(item => Object.assign({
|
|
7231
7233
|
value: item['_id'] || item['id'],
|
|
7232
7234
|
label: item['name']
|
|
7233
7235
|
}, item)));
|
|
7234
7236
|
if (formState === 'UPDATE') {
|
|
7237
|
+
console.log('collectionItems (stored IDs):', collectionItems); // Debug
|
|
7235
7238
|
let selectedOptions = (collectionItems === null || collectionItems === void 0 ? void 0 : collectionItems.map(itemId => {
|
|
7236
7239
|
item = options.find(item => item._id === itemId || item.id === itemId);
|
|
7237
7240
|
return item ? Object.assign({
|
|
@@ -7240,6 +7243,7 @@ const WidgetForm = ({
|
|
|
7240
7243
|
}, item) : {};
|
|
7241
7244
|
})) || [];
|
|
7242
7245
|
selectedOptions = selectedOptions.filter(obj => !!obj.value);
|
|
7246
|
+
console.log('selectedOptions (after mapping):', selectedOptions); // Debug
|
|
7243
7247
|
if (valueToSet) {
|
|
7244
7248
|
// only set tabcollection items, when they are not set
|
|
7245
7249
|
if (!tabCollectionItemsUpdated[activeTab]) {
|
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 "
|
|
@@ -4032,7 +4033,7 @@ const DNDItemsList = ({
|
|
|
4032
4033
|
className: "khb_DND-item",
|
|
4033
4034
|
key: item.value,
|
|
4034
4035
|
ref: provided.innerRef
|
|
4035
|
-
}, 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", {
|
|
4036
4037
|
className: "khb_DND-item-content"
|
|
4037
4038
|
}, /*#__PURE__*/React.createElement("p", {
|
|
4038
4039
|
className: "khb_DND-item-text"
|
|
@@ -7215,11 +7216,13 @@ const WidgetForm = ({
|
|
|
7215
7216
|
const collectionToUse = collectionName || (selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value);
|
|
7216
7217
|
callerRef.current = setTimeout(() => {
|
|
7217
7218
|
if (collectionToUse) getCollectionData(collectionToUse, str, options => {
|
|
7219
|
+
console.log('API options:', options); // Debug: see what comes from backend
|
|
7218
7220
|
if (typeof callback === 'function') callback(options.map(item => Object.assign({
|
|
7219
7221
|
value: item['_id'] || item['id'],
|
|
7220
7222
|
label: item['name']
|
|
7221
7223
|
}, item)));
|
|
7222
7224
|
if (formState === 'UPDATE') {
|
|
7225
|
+
console.log('collectionItems (stored IDs):', collectionItems); // Debug
|
|
7223
7226
|
let selectedOptions = (collectionItems === null || collectionItems === void 0 ? void 0 : collectionItems.map(itemId => {
|
|
7224
7227
|
item = options.find(item => item._id === itemId || item.id === itemId);
|
|
7225
7228
|
return item ? Object.assign({
|
|
@@ -7228,6 +7231,7 @@ const WidgetForm = ({
|
|
|
7228
7231
|
}, item) : {};
|
|
7229
7232
|
})) || [];
|
|
7230
7233
|
selectedOptions = selectedOptions.filter(obj => !!obj.value);
|
|
7234
|
+
console.log('selectedOptions (after mapping):', selectedOptions); // Debug
|
|
7231
7235
|
if (valueToSet) {
|
|
7232
7236
|
// only set tabcollection items, when they are not set
|
|
7233
7237
|
if (!tabCollectionItemsUpdated[activeTab]) {
|