@knovator/pagecreator-admin 1.7.7 → 1.7.8
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 +149 -9
- package/index.js +149 -9
- package/package.json +1 -1
- package/src/lib/components/Widget/Form/ItemsAccordian.d.ts +1 -1
- package/src/lib/components/Widget/Form/WidgetForm.d.ts +1 -1
- package/src/lib/components/Widget/Form/customItemRenderers/TestimonialItemRenderer.d.ts +4 -0
- package/src/lib/components/Widget/Form/customItemRenderers/defaultCustomItemRenderers.d.ts +3 -0
- package/src/lib/components/Widget/Widget/Widget.d.ts +2 -2
- package/src/lib/constants/common.d.ts +10 -0
- package/src/lib/types/components.d.ts +36 -1
package/index.cjs
CHANGED
|
@@ -1775,6 +1775,16 @@ const TRANSLATION_PAIRS_WIDGET = {
|
|
|
1775
1775
|
tabNameRequired: 'Tab Name is required',
|
|
1776
1776
|
subtitle: 'Subtitle',
|
|
1777
1777
|
subTitlePlaceholder: 'Enter Subtitle',
|
|
1778
|
+
quote: 'Quote',
|
|
1779
|
+
quotePlaceholder: 'Enter quote',
|
|
1780
|
+
personName: 'Person Name',
|
|
1781
|
+
personNamePlaceholder: 'Enter person name',
|
|
1782
|
+
personRole: 'Person Role',
|
|
1783
|
+
personRolePlaceholder: 'Enter person role',
|
|
1784
|
+
personOrganization: 'Organization',
|
|
1785
|
+
personOrganizationPlaceholder: 'Enter organization',
|
|
1786
|
+
rating: 'Rating',
|
|
1787
|
+
ratingPlaceholder: 'Enter rating',
|
|
1778
1788
|
altText: 'Alt Text',
|
|
1779
1789
|
altTextPlaceholder: 'Enter alt text',
|
|
1780
1790
|
link: 'Link',
|
|
@@ -3849,6 +3859,7 @@ const SimpleForm = /*#__PURE__*/React.forwardRef(({
|
|
|
3849
3859
|
setError,
|
|
3850
3860
|
languages
|
|
3851
3861
|
}, ref) => {
|
|
3862
|
+
const isMultilingualWidgetField = accessor => accessor === 'widgetTitles' || accessor === 'widgetSubtitles';
|
|
3852
3863
|
const inputRenderer = schema => {
|
|
3853
3864
|
var _a, _b, _c, _d;
|
|
3854
3865
|
let input;
|
|
@@ -3933,7 +3944,7 @@ const SimpleForm = /*#__PURE__*/React.forwardRef(({
|
|
|
3933
3944
|
case 'url':
|
|
3934
3945
|
case 'color':
|
|
3935
3946
|
default:
|
|
3936
|
-
if (Array.isArray(languages) && languages.length > 0 && schema.accessor
|
|
3947
|
+
if (Array.isArray(languages) && languages.length > 0 && isMultilingualWidgetField(schema.accessor)) {
|
|
3937
3948
|
input = languages.map(lang => {
|
|
3938
3949
|
var _a, _b;
|
|
3939
3950
|
return /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
@@ -3965,7 +3976,7 @@ const SimpleForm = /*#__PURE__*/React.forwardRef(({
|
|
|
3965
3976
|
break;
|
|
3966
3977
|
}
|
|
3967
3978
|
} else if (schema.Input) {
|
|
3968
|
-
if (Array.isArray(languages) && languages.length > 0 && schema.accessor
|
|
3979
|
+
if (Array.isArray(languages) && languages.length > 0 && isMultilingualWidgetField(schema.accessor)) {
|
|
3969
3980
|
input = languages.map(lang => (/*#__PURE__*/React__default["default"].createElement("div", {
|
|
3970
3981
|
key: lang.code,
|
|
3971
3982
|
className: classNames__default["default"]('khb_input-wrapper', schema.wrapperClassName)
|
|
@@ -6806,6 +6817,7 @@ const ItemsAccordian = ({
|
|
|
6806
6817
|
itemType,
|
|
6807
6818
|
languages,
|
|
6808
6819
|
clearError,
|
|
6820
|
+
customItemRenderer,
|
|
6809
6821
|
addText: _addText = 'Add',
|
|
6810
6822
|
deleteText: _deleteText = 'Delete'
|
|
6811
6823
|
}) => {
|
|
@@ -6846,6 +6858,13 @@ const ItemsAccordian = ({
|
|
|
6846
6858
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6847
6859
|
}, [errors, name, errors === null || errors === void 0 ? void 0 : errors[name]]);
|
|
6848
6860
|
const addTab = index => {
|
|
6861
|
+
if (customItemRenderer === null || customItemRenderer === void 0 ? void 0 : customItemRenderer.createItem) {
|
|
6862
|
+
appendItem(customItemRenderer.createItem({
|
|
6863
|
+
index,
|
|
6864
|
+
itemType
|
|
6865
|
+
}));
|
|
6866
|
+
return;
|
|
6867
|
+
}
|
|
6849
6868
|
appendItem({
|
|
6850
6869
|
altText: '',
|
|
6851
6870
|
link: '',
|
|
@@ -6889,7 +6908,20 @@ const ItemsAccordian = ({
|
|
|
6889
6908
|
}, _deleteText))
|
|
6890
6909
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
6891
6910
|
className: "khb-form-items"
|
|
6892
|
-
},
|
|
6911
|
+
}, customItemRenderer ? customItemRenderer.render({
|
|
6912
|
+
name,
|
|
6913
|
+
index,
|
|
6914
|
+
itemType,
|
|
6915
|
+
errors,
|
|
6916
|
+
control,
|
|
6917
|
+
register,
|
|
6918
|
+
setError,
|
|
6919
|
+
clearError,
|
|
6920
|
+
languages,
|
|
6921
|
+
loading,
|
|
6922
|
+
widgetTranslations,
|
|
6923
|
+
commonTranslations
|
|
6924
|
+
}) : (/*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, Array.isArray(languages) && languages.length > 0 ? (/*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, languages.map(lang => {
|
|
6893
6925
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6894
6926
|
return /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
6895
6927
|
rest: register(`${name}.${index}.titles.${lang.code}`),
|
|
@@ -6992,7 +7024,7 @@ const ItemsAccordian = ({
|
|
|
6992
7024
|
}, widgetTranslations.dragDrop)), /*#__PURE__*/React__default["default"].createElement("p", {
|
|
6993
7025
|
className: "khb_img-text-2"
|
|
6994
7026
|
}, widgetTranslations.allowedFormat))
|
|
6995
|
-
}))));
|
|
7027
|
+
}))))));
|
|
6996
7028
|
})));
|
|
6997
7029
|
};
|
|
6998
7030
|
|
|
@@ -7179,6 +7211,7 @@ const constants = {
|
|
|
7179
7211
|
textWidgetTypeValue: 'Text',
|
|
7180
7212
|
htmlWidgetTypeValue: 'HTML',
|
|
7181
7213
|
linksWidgetTypeValue: 'Links',
|
|
7214
|
+
testimonialWidgetTypeValue: 'Testimonial',
|
|
7182
7215
|
pagesItemsTypeValue: 'pages',
|
|
7183
7216
|
tabsAccessor: 'tabs',
|
|
7184
7217
|
webItems: 'webItems',
|
|
@@ -7188,6 +7221,7 @@ const constants = {
|
|
|
7188
7221
|
const WidgetForm = ({
|
|
7189
7222
|
formRef,
|
|
7190
7223
|
customInputs,
|
|
7224
|
+
customItemRenderers,
|
|
7191
7225
|
onPrimaryButtonClick
|
|
7192
7226
|
}) => {
|
|
7193
7227
|
const {
|
|
@@ -7251,6 +7285,8 @@ const WidgetForm = ({
|
|
|
7251
7285
|
const [blogCategoriesLoading, setBlogCategoriesLoading] = React.useState(false);
|
|
7252
7286
|
const pagesLoadedRef = React.useRef(false);
|
|
7253
7287
|
const blogCategoryInitialized = React.useRef(false);
|
|
7288
|
+
const selectedWidgetTypeValue = (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) || getValues(constants.widgetTypeAccessor);
|
|
7289
|
+
const selectedCustomItemRenderer = selectedWidgetTypeValue ? customItemRenderers === null || customItemRenderers === void 0 ? void 0 : customItemRenderers[selectedWidgetTypeValue] : undefined;
|
|
7254
7290
|
React.useEffect(() => {
|
|
7255
7291
|
if (data && formState === 'UPDATE') {
|
|
7256
7292
|
const widgetType = widgetTypes.find(type => type.value === (data === null || data === void 0 ? void 0 : data.widgetType));
|
|
@@ -7454,6 +7490,15 @@ const WidgetForm = ({
|
|
|
7454
7490
|
setValue(constants.collectionNameAccessor, constants.pagesItemsTypeValue);
|
|
7455
7491
|
const pagesOption = itemsTypes.find(item => item.value === constants.pagesItemsTypeValue);
|
|
7456
7492
|
if (pagesOption) setSelectedCollectionType(pagesOption);
|
|
7493
|
+
} else if ((widgetType === null || widgetType === void 0 ? void 0 : widgetType.value) === constants.testimonialWidgetTypeValue) {
|
|
7494
|
+
setItemsEnabled(true);
|
|
7495
|
+
setSelectedCollectionType(undefined);
|
|
7496
|
+
setSelectedCollectionItems([]);
|
|
7497
|
+
setValue(constants.itemTypeAccessor, constants.imageItemsTypeValue);
|
|
7498
|
+
setValue(constants.collectionNameAccessor, constants.imageItemsTypeValue);
|
|
7499
|
+
setValue('webPerRow', 4);
|
|
7500
|
+
setValue('tabletPerRow', 2);
|
|
7501
|
+
setValue('mobilePerRow', 1);
|
|
7457
7502
|
} else {
|
|
7458
7503
|
setItemsEnabled(true);
|
|
7459
7504
|
}
|
|
@@ -7669,6 +7714,22 @@ const WidgetForm = ({
|
|
|
7669
7714
|
},
|
|
7670
7715
|
info: widgetTranslations.widgetTitleInfo,
|
|
7671
7716
|
Input: customInputs && customInputs['widgetTitle'] ? customInputs['widgetTitle'] : undefined
|
|
7717
|
+
}, Array.isArray(languages) && languages.length > 0 ? {
|
|
7718
|
+
label: widgetTranslations.subtitle,
|
|
7719
|
+
accessor: 'widgetSubtitles',
|
|
7720
|
+
required: false,
|
|
7721
|
+
type: customInputs && customInputs['widgetSubtitles'] ? undefined : 'text',
|
|
7722
|
+
placeholder: widgetTranslations.subTitlePlaceholder,
|
|
7723
|
+
onInput: handleCapitalize,
|
|
7724
|
+
Input: customInputs && customInputs['widgetSubtitles'] ? customInputs['widgetSubtitles'] : undefined
|
|
7725
|
+
} : {
|
|
7726
|
+
label: widgetTranslations.subtitle,
|
|
7727
|
+
accessor: 'widgetSubtitle',
|
|
7728
|
+
required: false,
|
|
7729
|
+
type: customInputs && customInputs['widgetSubtitle'] ? undefined : 'text',
|
|
7730
|
+
onInput: handleCapitalize,
|
|
7731
|
+
placeholder: widgetTranslations.subTitlePlaceholder,
|
|
7732
|
+
Input: customInputs && customInputs['widgetSubtitle'] ? customInputs['widgetSubtitle'] : undefined
|
|
7672
7733
|
}, {
|
|
7673
7734
|
label: widgetTranslations.widgetType,
|
|
7674
7735
|
required: true,
|
|
@@ -7713,7 +7774,7 @@ const WidgetForm = ({
|
|
|
7713
7774
|
label: widgetTranslations.itemsType,
|
|
7714
7775
|
required: true,
|
|
7715
7776
|
editable: false,
|
|
7716
|
-
show:
|
|
7777
|
+
show: selectedWidgetTypeValue !== constants.textWidgetTypeValue && selectedWidgetTypeValue !== constants.htmlWidgetTypeValue && selectedWidgetTypeValue !== constants.testimonialWidgetTypeValue,
|
|
7717
7778
|
accessor: constants.itemTypeAccessor,
|
|
7718
7779
|
type: 'select',
|
|
7719
7780
|
validations: {
|
|
@@ -7925,7 +7986,8 @@ const WidgetForm = ({
|
|
|
7925
7986
|
register: register,
|
|
7926
7987
|
loading: loading,
|
|
7927
7988
|
addText: commonTranslations.add,
|
|
7928
|
-
deleteText: commonTranslations.delete
|
|
7989
|
+
deleteText: commonTranslations.delete,
|
|
7990
|
+
customItemRenderer: selectedCustomItemRenderer
|
|
7929
7991
|
}), /*#__PURE__*/React__default["default"].createElement(ItemsAccordian, {
|
|
7930
7992
|
languages: languages,
|
|
7931
7993
|
clearError: clearErrors,
|
|
@@ -7942,7 +8004,8 @@ const WidgetForm = ({
|
|
|
7942
8004
|
control: control,
|
|
7943
8005
|
register: register,
|
|
7944
8006
|
addText: commonTranslations.add,
|
|
7945
|
-
deleteText: commonTranslations.delete
|
|
8007
|
+
deleteText: commonTranslations.delete,
|
|
8008
|
+
customItemRenderer: selectedCustomItemRenderer
|
|
7946
8009
|
}))));
|
|
7947
8010
|
};
|
|
7948
8011
|
|
|
@@ -8065,6 +8128,79 @@ const WiddgetFormWrapper = ({
|
|
|
8065
8128
|
}) : null;
|
|
8066
8129
|
};
|
|
8067
8130
|
|
|
8131
|
+
const TestimonialItemRenderer = ({
|
|
8132
|
+
name,
|
|
8133
|
+
index,
|
|
8134
|
+
register,
|
|
8135
|
+
errors,
|
|
8136
|
+
widgetTranslations
|
|
8137
|
+
}) => {
|
|
8138
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
8139
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
8140
|
+
rest: register(`${name}.${index}.quote`),
|
|
8141
|
+
label: widgetTranslations.quote,
|
|
8142
|
+
error: (_d = (_c = (_b = (_a = errors[name]) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b['quote']) === null || _c === void 0 ? void 0 : _c.message) === null || _d === void 0 ? void 0 : _d.toString(),
|
|
8143
|
+
type: "textarea",
|
|
8144
|
+
className: "w-full p-2",
|
|
8145
|
+
placeholder: widgetTranslations.quotePlaceholder
|
|
8146
|
+
}), /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
8147
|
+
rest: register(`${name}.${index}.personName`),
|
|
8148
|
+
label: widgetTranslations.personName,
|
|
8149
|
+
error: (_h = (_g = (_f = (_e = errors[name]) === null || _e === void 0 ? void 0 : _e[index]) === null || _f === void 0 ? void 0 : _f['personName']) === null || _g === void 0 ? void 0 : _g.message) === null || _h === void 0 ? void 0 : _h.toString(),
|
|
8150
|
+
type: "text",
|
|
8151
|
+
className: "w-full p-2",
|
|
8152
|
+
placeholder: widgetTranslations.personNamePlaceholder
|
|
8153
|
+
}), /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
8154
|
+
rest: register(`${name}.${index}.personRole`),
|
|
8155
|
+
label: widgetTranslations.personRole,
|
|
8156
|
+
error: (_m = (_l = (_k = (_j = errors[name]) === null || _j === void 0 ? void 0 : _j[index]) === null || _k === void 0 ? void 0 : _k['personRole']) === null || _l === void 0 ? void 0 : _l.message) === null || _m === void 0 ? void 0 : _m.toString(),
|
|
8157
|
+
type: "text",
|
|
8158
|
+
className: "w-full p-2",
|
|
8159
|
+
placeholder: widgetTranslations.personRolePlaceholder
|
|
8160
|
+
}), /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
8161
|
+
rest: register(`${name}.${index}.personOrganization`),
|
|
8162
|
+
label: widgetTranslations.personOrganization,
|
|
8163
|
+
error: (_r = (_q = (_p = (_o = errors[name]) === null || _o === void 0 ? void 0 : _o[index]) === null || _p === void 0 ? void 0 : _p['personOrganization']) === null || _q === void 0 ? void 0 : _q.message) === null || _r === void 0 ? void 0 : _r.toString(),
|
|
8164
|
+
type: "text",
|
|
8165
|
+
className: "w-full p-2",
|
|
8166
|
+
placeholder: widgetTranslations.personOrganizationPlaceholder
|
|
8167
|
+
}), /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
8168
|
+
rest: register(`${name}.${index}.rating`, {
|
|
8169
|
+
min: {
|
|
8170
|
+
value: 0,
|
|
8171
|
+
message: 'Rating should be greater than or equal to 0'
|
|
8172
|
+
},
|
|
8173
|
+
max: {
|
|
8174
|
+
value: 5,
|
|
8175
|
+
message: 'Rating should be less than or equal to 5'
|
|
8176
|
+
}
|
|
8177
|
+
}),
|
|
8178
|
+
label: widgetTranslations.rating,
|
|
8179
|
+
error: (_v = (_u = (_t = (_s = errors[name]) === null || _s === void 0 ? void 0 : _s[index]) === null || _t === void 0 ? void 0 : _t['rating']) === null || _u === void 0 ? void 0 : _u.message) === null || _v === void 0 ? void 0 : _v.toString(),
|
|
8180
|
+
type: "number",
|
|
8181
|
+
className: "w-full p-2",
|
|
8182
|
+
placeholder: widgetTranslations.ratingPlaceholder
|
|
8183
|
+
}));
|
|
8184
|
+
};
|
|
8185
|
+
|
|
8186
|
+
const getDefaultCustomItemRenderers = () => ({
|
|
8187
|
+
Testimonial: {
|
|
8188
|
+
render: TestimonialItemRenderer,
|
|
8189
|
+
createItem: ({
|
|
8190
|
+
index,
|
|
8191
|
+
itemType
|
|
8192
|
+
}) => ({
|
|
8193
|
+
quote: '',
|
|
8194
|
+
personName: '',
|
|
8195
|
+
personRole: '',
|
|
8196
|
+
personOrganization: '',
|
|
8197
|
+
rating: 5,
|
|
8198
|
+
itemType,
|
|
8199
|
+
sequence: index
|
|
8200
|
+
})
|
|
8201
|
+
}
|
|
8202
|
+
});
|
|
8203
|
+
|
|
8068
8204
|
const Widget = ({
|
|
8069
8205
|
routes,
|
|
8070
8206
|
loader,
|
|
@@ -8079,7 +8215,8 @@ const Widget = ({
|
|
|
8079
8215
|
imageMaxSize,
|
|
8080
8216
|
translations,
|
|
8081
8217
|
children,
|
|
8082
|
-
onPrimaryButtonClick
|
|
8218
|
+
onPrimaryButtonClick,
|
|
8219
|
+
customItemRenderers
|
|
8083
8220
|
}) => {
|
|
8084
8221
|
const {
|
|
8085
8222
|
commonTranslations
|
|
@@ -8087,6 +8224,8 @@ const Widget = ({
|
|
|
8087
8224
|
const derivedPermissions = Object.assign(DEFAULT_PERMISSIONS, _permissions);
|
|
8088
8225
|
const widgetFormRef = React.useRef(null);
|
|
8089
8226
|
const derivedT = Object.assign(Object.assign({}, TRANSLATION_PAIRS_WIDGET), translations || {});
|
|
8227
|
+
const defaultCustomItemRenderers = getDefaultCustomItemRenderers();
|
|
8228
|
+
const derivedCustomItemRenderers = Object.assign(Object.assign({}, defaultCustomItemRenderers), customItemRenderers || {});
|
|
8090
8229
|
const {
|
|
8091
8230
|
list,
|
|
8092
8231
|
loading,
|
|
@@ -8171,7 +8310,8 @@ const Widget = ({
|
|
|
8171
8310
|
})
|
|
8172
8311
|
}, /*#__PURE__*/React__default["default"].createElement(WidgetForm, {
|
|
8173
8312
|
formRef: widgetFormRef,
|
|
8174
|
-
onPrimaryButtonClick: onPrimaryButtonClick
|
|
8313
|
+
onPrimaryButtonClick: onPrimaryButtonClick,
|
|
8314
|
+
customItemRenderers: derivedCustomItemRenderers
|
|
8175
8315
|
}))), itemData && (/*#__PURE__*/React__default["default"].createElement(DeleteModal, {
|
|
8176
8316
|
formState: formState,
|
|
8177
8317
|
itemData: itemData,
|
package/index.js
CHANGED
|
@@ -1763,6 +1763,16 @@ const TRANSLATION_PAIRS_WIDGET = {
|
|
|
1763
1763
|
tabNameRequired: 'Tab Name is required',
|
|
1764
1764
|
subtitle: 'Subtitle',
|
|
1765
1765
|
subTitlePlaceholder: 'Enter Subtitle',
|
|
1766
|
+
quote: 'Quote',
|
|
1767
|
+
quotePlaceholder: 'Enter quote',
|
|
1768
|
+
personName: 'Person Name',
|
|
1769
|
+
personNamePlaceholder: 'Enter person name',
|
|
1770
|
+
personRole: 'Person Role',
|
|
1771
|
+
personRolePlaceholder: 'Enter person role',
|
|
1772
|
+
personOrganization: 'Organization',
|
|
1773
|
+
personOrganizationPlaceholder: 'Enter organization',
|
|
1774
|
+
rating: 'Rating',
|
|
1775
|
+
ratingPlaceholder: 'Enter rating',
|
|
1766
1776
|
altText: 'Alt Text',
|
|
1767
1777
|
altTextPlaceholder: 'Enter alt text',
|
|
1768
1778
|
link: 'Link',
|
|
@@ -3837,6 +3847,7 @@ const SimpleForm = /*#__PURE__*/forwardRef(({
|
|
|
3837
3847
|
setError,
|
|
3838
3848
|
languages
|
|
3839
3849
|
}, ref) => {
|
|
3850
|
+
const isMultilingualWidgetField = accessor => accessor === 'widgetTitles' || accessor === 'widgetSubtitles';
|
|
3840
3851
|
const inputRenderer = schema => {
|
|
3841
3852
|
var _a, _b, _c, _d;
|
|
3842
3853
|
let input;
|
|
@@ -3921,7 +3932,7 @@ const SimpleForm = /*#__PURE__*/forwardRef(({
|
|
|
3921
3932
|
case 'url':
|
|
3922
3933
|
case 'color':
|
|
3923
3934
|
default:
|
|
3924
|
-
if (Array.isArray(languages) && languages.length > 0 && schema.accessor
|
|
3935
|
+
if (Array.isArray(languages) && languages.length > 0 && isMultilingualWidgetField(schema.accessor)) {
|
|
3925
3936
|
input = languages.map(lang => {
|
|
3926
3937
|
var _a, _b;
|
|
3927
3938
|
return /*#__PURE__*/React.createElement(Input, {
|
|
@@ -3953,7 +3964,7 @@ const SimpleForm = /*#__PURE__*/forwardRef(({
|
|
|
3953
3964
|
break;
|
|
3954
3965
|
}
|
|
3955
3966
|
} else if (schema.Input) {
|
|
3956
|
-
if (Array.isArray(languages) && languages.length > 0 && schema.accessor
|
|
3967
|
+
if (Array.isArray(languages) && languages.length > 0 && isMultilingualWidgetField(schema.accessor)) {
|
|
3957
3968
|
input = languages.map(lang => (/*#__PURE__*/React.createElement("div", {
|
|
3958
3969
|
key: lang.code,
|
|
3959
3970
|
className: classNames('khb_input-wrapper', schema.wrapperClassName)
|
|
@@ -6794,6 +6805,7 @@ const ItemsAccordian = ({
|
|
|
6794
6805
|
itemType,
|
|
6795
6806
|
languages,
|
|
6796
6807
|
clearError,
|
|
6808
|
+
customItemRenderer,
|
|
6797
6809
|
addText: _addText = 'Add',
|
|
6798
6810
|
deleteText: _deleteText = 'Delete'
|
|
6799
6811
|
}) => {
|
|
@@ -6834,6 +6846,13 @@ const ItemsAccordian = ({
|
|
|
6834
6846
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6835
6847
|
}, [errors, name, errors === null || errors === void 0 ? void 0 : errors[name]]);
|
|
6836
6848
|
const addTab = index => {
|
|
6849
|
+
if (customItemRenderer === null || customItemRenderer === void 0 ? void 0 : customItemRenderer.createItem) {
|
|
6850
|
+
appendItem(customItemRenderer.createItem({
|
|
6851
|
+
index,
|
|
6852
|
+
itemType
|
|
6853
|
+
}));
|
|
6854
|
+
return;
|
|
6855
|
+
}
|
|
6837
6856
|
appendItem({
|
|
6838
6857
|
altText: '',
|
|
6839
6858
|
link: '',
|
|
@@ -6877,7 +6896,20 @@ const ItemsAccordian = ({
|
|
|
6877
6896
|
}, _deleteText))
|
|
6878
6897
|
}, /*#__PURE__*/React.createElement("div", {
|
|
6879
6898
|
className: "khb-form-items"
|
|
6880
|
-
},
|
|
6899
|
+
}, customItemRenderer ? customItemRenderer.render({
|
|
6900
|
+
name,
|
|
6901
|
+
index,
|
|
6902
|
+
itemType,
|
|
6903
|
+
errors,
|
|
6904
|
+
control,
|
|
6905
|
+
register,
|
|
6906
|
+
setError,
|
|
6907
|
+
clearError,
|
|
6908
|
+
languages,
|
|
6909
|
+
loading,
|
|
6910
|
+
widgetTranslations,
|
|
6911
|
+
commonTranslations
|
|
6912
|
+
}) : (/*#__PURE__*/React.createElement(React.Fragment, null, Array.isArray(languages) && languages.length > 0 ? (/*#__PURE__*/React.createElement(React.Fragment, null, languages.map(lang => {
|
|
6881
6913
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6882
6914
|
return /*#__PURE__*/React.createElement(Input, {
|
|
6883
6915
|
rest: register(`${name}.${index}.titles.${lang.code}`),
|
|
@@ -6980,7 +7012,7 @@ const ItemsAccordian = ({
|
|
|
6980
7012
|
}, widgetTranslations.dragDrop)), /*#__PURE__*/React.createElement("p", {
|
|
6981
7013
|
className: "khb_img-text-2"
|
|
6982
7014
|
}, widgetTranslations.allowedFormat))
|
|
6983
|
-
}))));
|
|
7015
|
+
}))))));
|
|
6984
7016
|
})));
|
|
6985
7017
|
};
|
|
6986
7018
|
|
|
@@ -7167,6 +7199,7 @@ const constants = {
|
|
|
7167
7199
|
textWidgetTypeValue: 'Text',
|
|
7168
7200
|
htmlWidgetTypeValue: 'HTML',
|
|
7169
7201
|
linksWidgetTypeValue: 'Links',
|
|
7202
|
+
testimonialWidgetTypeValue: 'Testimonial',
|
|
7170
7203
|
pagesItemsTypeValue: 'pages',
|
|
7171
7204
|
tabsAccessor: 'tabs',
|
|
7172
7205
|
webItems: 'webItems',
|
|
@@ -7176,6 +7209,7 @@ const constants = {
|
|
|
7176
7209
|
const WidgetForm = ({
|
|
7177
7210
|
formRef,
|
|
7178
7211
|
customInputs,
|
|
7212
|
+
customItemRenderers,
|
|
7179
7213
|
onPrimaryButtonClick
|
|
7180
7214
|
}) => {
|
|
7181
7215
|
const {
|
|
@@ -7239,6 +7273,8 @@ const WidgetForm = ({
|
|
|
7239
7273
|
const [blogCategoriesLoading, setBlogCategoriesLoading] = useState(false);
|
|
7240
7274
|
const pagesLoadedRef = useRef(false);
|
|
7241
7275
|
const blogCategoryInitialized = useRef(false);
|
|
7276
|
+
const selectedWidgetTypeValue = (selectedWidgetType === null || selectedWidgetType === void 0 ? void 0 : selectedWidgetType.value) || getValues(constants.widgetTypeAccessor);
|
|
7277
|
+
const selectedCustomItemRenderer = selectedWidgetTypeValue ? customItemRenderers === null || customItemRenderers === void 0 ? void 0 : customItemRenderers[selectedWidgetTypeValue] : undefined;
|
|
7242
7278
|
useEffect(() => {
|
|
7243
7279
|
if (data && formState === 'UPDATE') {
|
|
7244
7280
|
const widgetType = widgetTypes.find(type => type.value === (data === null || data === void 0 ? void 0 : data.widgetType));
|
|
@@ -7442,6 +7478,15 @@ const WidgetForm = ({
|
|
|
7442
7478
|
setValue(constants.collectionNameAccessor, constants.pagesItemsTypeValue);
|
|
7443
7479
|
const pagesOption = itemsTypes.find(item => item.value === constants.pagesItemsTypeValue);
|
|
7444
7480
|
if (pagesOption) setSelectedCollectionType(pagesOption);
|
|
7481
|
+
} else if ((widgetType === null || widgetType === void 0 ? void 0 : widgetType.value) === constants.testimonialWidgetTypeValue) {
|
|
7482
|
+
setItemsEnabled(true);
|
|
7483
|
+
setSelectedCollectionType(undefined);
|
|
7484
|
+
setSelectedCollectionItems([]);
|
|
7485
|
+
setValue(constants.itemTypeAccessor, constants.imageItemsTypeValue);
|
|
7486
|
+
setValue(constants.collectionNameAccessor, constants.imageItemsTypeValue);
|
|
7487
|
+
setValue('webPerRow', 4);
|
|
7488
|
+
setValue('tabletPerRow', 2);
|
|
7489
|
+
setValue('mobilePerRow', 1);
|
|
7445
7490
|
} else {
|
|
7446
7491
|
setItemsEnabled(true);
|
|
7447
7492
|
}
|
|
@@ -7657,6 +7702,22 @@ const WidgetForm = ({
|
|
|
7657
7702
|
},
|
|
7658
7703
|
info: widgetTranslations.widgetTitleInfo,
|
|
7659
7704
|
Input: customInputs && customInputs['widgetTitle'] ? customInputs['widgetTitle'] : undefined
|
|
7705
|
+
}, Array.isArray(languages) && languages.length > 0 ? {
|
|
7706
|
+
label: widgetTranslations.subtitle,
|
|
7707
|
+
accessor: 'widgetSubtitles',
|
|
7708
|
+
required: false,
|
|
7709
|
+
type: customInputs && customInputs['widgetSubtitles'] ? undefined : 'text',
|
|
7710
|
+
placeholder: widgetTranslations.subTitlePlaceholder,
|
|
7711
|
+
onInput: handleCapitalize,
|
|
7712
|
+
Input: customInputs && customInputs['widgetSubtitles'] ? customInputs['widgetSubtitles'] : undefined
|
|
7713
|
+
} : {
|
|
7714
|
+
label: widgetTranslations.subtitle,
|
|
7715
|
+
accessor: 'widgetSubtitle',
|
|
7716
|
+
required: false,
|
|
7717
|
+
type: customInputs && customInputs['widgetSubtitle'] ? undefined : 'text',
|
|
7718
|
+
onInput: handleCapitalize,
|
|
7719
|
+
placeholder: widgetTranslations.subTitlePlaceholder,
|
|
7720
|
+
Input: customInputs && customInputs['widgetSubtitle'] ? customInputs['widgetSubtitle'] : undefined
|
|
7660
7721
|
}, {
|
|
7661
7722
|
label: widgetTranslations.widgetType,
|
|
7662
7723
|
required: true,
|
|
@@ -7701,7 +7762,7 @@ const WidgetForm = ({
|
|
|
7701
7762
|
label: widgetTranslations.itemsType,
|
|
7702
7763
|
required: true,
|
|
7703
7764
|
editable: false,
|
|
7704
|
-
show:
|
|
7765
|
+
show: selectedWidgetTypeValue !== constants.textWidgetTypeValue && selectedWidgetTypeValue !== constants.htmlWidgetTypeValue && selectedWidgetTypeValue !== constants.testimonialWidgetTypeValue,
|
|
7705
7766
|
accessor: constants.itemTypeAccessor,
|
|
7706
7767
|
type: 'select',
|
|
7707
7768
|
validations: {
|
|
@@ -7913,7 +7974,8 @@ const WidgetForm = ({
|
|
|
7913
7974
|
register: register,
|
|
7914
7975
|
loading: loading,
|
|
7915
7976
|
addText: commonTranslations.add,
|
|
7916
|
-
deleteText: commonTranslations.delete
|
|
7977
|
+
deleteText: commonTranslations.delete,
|
|
7978
|
+
customItemRenderer: selectedCustomItemRenderer
|
|
7917
7979
|
}), /*#__PURE__*/React.createElement(ItemsAccordian, {
|
|
7918
7980
|
languages: languages,
|
|
7919
7981
|
clearError: clearErrors,
|
|
@@ -7930,7 +7992,8 @@ const WidgetForm = ({
|
|
|
7930
7992
|
control: control,
|
|
7931
7993
|
register: register,
|
|
7932
7994
|
addText: commonTranslations.add,
|
|
7933
|
-
deleteText: commonTranslations.delete
|
|
7995
|
+
deleteText: commonTranslations.delete,
|
|
7996
|
+
customItemRenderer: selectedCustomItemRenderer
|
|
7934
7997
|
}))));
|
|
7935
7998
|
};
|
|
7936
7999
|
|
|
@@ -8053,6 +8116,79 @@ const WiddgetFormWrapper = ({
|
|
|
8053
8116
|
}) : null;
|
|
8054
8117
|
};
|
|
8055
8118
|
|
|
8119
|
+
const TestimonialItemRenderer = ({
|
|
8120
|
+
name,
|
|
8121
|
+
index,
|
|
8122
|
+
register,
|
|
8123
|
+
errors,
|
|
8124
|
+
widgetTranslations
|
|
8125
|
+
}) => {
|
|
8126
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
8127
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Input, {
|
|
8128
|
+
rest: register(`${name}.${index}.quote`),
|
|
8129
|
+
label: widgetTranslations.quote,
|
|
8130
|
+
error: (_d = (_c = (_b = (_a = errors[name]) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b['quote']) === null || _c === void 0 ? void 0 : _c.message) === null || _d === void 0 ? void 0 : _d.toString(),
|
|
8131
|
+
type: "textarea",
|
|
8132
|
+
className: "w-full p-2",
|
|
8133
|
+
placeholder: widgetTranslations.quotePlaceholder
|
|
8134
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
8135
|
+
rest: register(`${name}.${index}.personName`),
|
|
8136
|
+
label: widgetTranslations.personName,
|
|
8137
|
+
error: (_h = (_g = (_f = (_e = errors[name]) === null || _e === void 0 ? void 0 : _e[index]) === null || _f === void 0 ? void 0 : _f['personName']) === null || _g === void 0 ? void 0 : _g.message) === null || _h === void 0 ? void 0 : _h.toString(),
|
|
8138
|
+
type: "text",
|
|
8139
|
+
className: "w-full p-2",
|
|
8140
|
+
placeholder: widgetTranslations.personNamePlaceholder
|
|
8141
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
8142
|
+
rest: register(`${name}.${index}.personRole`),
|
|
8143
|
+
label: widgetTranslations.personRole,
|
|
8144
|
+
error: (_m = (_l = (_k = (_j = errors[name]) === null || _j === void 0 ? void 0 : _j[index]) === null || _k === void 0 ? void 0 : _k['personRole']) === null || _l === void 0 ? void 0 : _l.message) === null || _m === void 0 ? void 0 : _m.toString(),
|
|
8145
|
+
type: "text",
|
|
8146
|
+
className: "w-full p-2",
|
|
8147
|
+
placeholder: widgetTranslations.personRolePlaceholder
|
|
8148
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
8149
|
+
rest: register(`${name}.${index}.personOrganization`),
|
|
8150
|
+
label: widgetTranslations.personOrganization,
|
|
8151
|
+
error: (_r = (_q = (_p = (_o = errors[name]) === null || _o === void 0 ? void 0 : _o[index]) === null || _p === void 0 ? void 0 : _p['personOrganization']) === null || _q === void 0 ? void 0 : _q.message) === null || _r === void 0 ? void 0 : _r.toString(),
|
|
8152
|
+
type: "text",
|
|
8153
|
+
className: "w-full p-2",
|
|
8154
|
+
placeholder: widgetTranslations.personOrganizationPlaceholder
|
|
8155
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
8156
|
+
rest: register(`${name}.${index}.rating`, {
|
|
8157
|
+
min: {
|
|
8158
|
+
value: 0,
|
|
8159
|
+
message: 'Rating should be greater than or equal to 0'
|
|
8160
|
+
},
|
|
8161
|
+
max: {
|
|
8162
|
+
value: 5,
|
|
8163
|
+
message: 'Rating should be less than or equal to 5'
|
|
8164
|
+
}
|
|
8165
|
+
}),
|
|
8166
|
+
label: widgetTranslations.rating,
|
|
8167
|
+
error: (_v = (_u = (_t = (_s = errors[name]) === null || _s === void 0 ? void 0 : _s[index]) === null || _t === void 0 ? void 0 : _t['rating']) === null || _u === void 0 ? void 0 : _u.message) === null || _v === void 0 ? void 0 : _v.toString(),
|
|
8168
|
+
type: "number",
|
|
8169
|
+
className: "w-full p-2",
|
|
8170
|
+
placeholder: widgetTranslations.ratingPlaceholder
|
|
8171
|
+
}));
|
|
8172
|
+
};
|
|
8173
|
+
|
|
8174
|
+
const getDefaultCustomItemRenderers = () => ({
|
|
8175
|
+
Testimonial: {
|
|
8176
|
+
render: TestimonialItemRenderer,
|
|
8177
|
+
createItem: ({
|
|
8178
|
+
index,
|
|
8179
|
+
itemType
|
|
8180
|
+
}) => ({
|
|
8181
|
+
quote: '',
|
|
8182
|
+
personName: '',
|
|
8183
|
+
personRole: '',
|
|
8184
|
+
personOrganization: '',
|
|
8185
|
+
rating: 5,
|
|
8186
|
+
itemType,
|
|
8187
|
+
sequence: index
|
|
8188
|
+
})
|
|
8189
|
+
}
|
|
8190
|
+
});
|
|
8191
|
+
|
|
8056
8192
|
const Widget = ({
|
|
8057
8193
|
routes,
|
|
8058
8194
|
loader,
|
|
@@ -8067,7 +8203,8 @@ const Widget = ({
|
|
|
8067
8203
|
imageMaxSize,
|
|
8068
8204
|
translations,
|
|
8069
8205
|
children,
|
|
8070
|
-
onPrimaryButtonClick
|
|
8206
|
+
onPrimaryButtonClick,
|
|
8207
|
+
customItemRenderers
|
|
8071
8208
|
}) => {
|
|
8072
8209
|
const {
|
|
8073
8210
|
commonTranslations
|
|
@@ -8075,6 +8212,8 @@ const Widget = ({
|
|
|
8075
8212
|
const derivedPermissions = Object.assign(DEFAULT_PERMISSIONS, _permissions);
|
|
8076
8213
|
const widgetFormRef = useRef(null);
|
|
8077
8214
|
const derivedT = Object.assign(Object.assign({}, TRANSLATION_PAIRS_WIDGET), translations || {});
|
|
8215
|
+
const defaultCustomItemRenderers = getDefaultCustomItemRenderers();
|
|
8216
|
+
const derivedCustomItemRenderers = Object.assign(Object.assign({}, defaultCustomItemRenderers), customItemRenderers || {});
|
|
8078
8217
|
const {
|
|
8079
8218
|
list,
|
|
8080
8219
|
loading,
|
|
@@ -8159,7 +8298,8 @@ const Widget = ({
|
|
|
8159
8298
|
})
|
|
8160
8299
|
}, /*#__PURE__*/React.createElement(WidgetForm, {
|
|
8161
8300
|
formRef: widgetFormRef,
|
|
8162
|
-
onPrimaryButtonClick: onPrimaryButtonClick
|
|
8301
|
+
onPrimaryButtonClick: onPrimaryButtonClick,
|
|
8302
|
+
customItemRenderers: derivedCustomItemRenderers
|
|
8163
8303
|
}))), itemData && (/*#__PURE__*/React.createElement(DeleteModal, {
|
|
8164
8304
|
formState: formState,
|
|
8165
8305
|
itemData: itemData,
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ItemsAccordianProps } from '../../../types';
|
|
3
|
-
declare const ItemsAccordian: ({ show, title, id, collapseId, toggleShow, loading, name, errors, control, register, setError, itemType, languages, clearError, addText, deleteText, }: ItemsAccordianProps) => JSX.Element;
|
|
3
|
+
declare const ItemsAccordian: ({ show, title, id, collapseId, toggleShow, loading, name, errors, control, register, setError, itemType, languages, clearError, customItemRenderer, addText, deleteText, }: ItemsAccordianProps) => JSX.Element;
|
|
4
4
|
export default ItemsAccordian;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormProps } from '../../../types';
|
|
3
|
-
declare const WidgetForm: ({ formRef, customInputs, onPrimaryButtonClick }: FormProps) => JSX.Element | null;
|
|
3
|
+
declare const WidgetForm: ({ formRef, customInputs, customItemRenderers, onPrimaryButtonClick, }: FormProps) => JSX.Element | null;
|
|
4
4
|
export default WidgetForm;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { WidgetProps } from '../../../types';
|
|
3
3
|
declare const Widget: {
|
|
4
|
-
({ routes, loader, explicitForm, imageBaseUrl, permissions, preConfirmDelete, formatListItem, formatOptionLabel, imageMaxSize, translations, children, onPrimaryButtonClick, }: WidgetProps): JSX.Element;
|
|
4
|
+
({ routes, loader, explicitForm, imageBaseUrl, permissions, preConfirmDelete, formatListItem, formatOptionLabel, imageMaxSize, translations, children, onPrimaryButtonClick, customItemRenderers, }: WidgetProps): JSX.Element;
|
|
5
5
|
Table: ({ extraActions, extraColumns }: import("../../../types").DerivedTableProps) => JSX.Element;
|
|
6
|
-
Form: ({ formRef, customInputs, onPrimaryButtonClick }: import("../../../types").FormProps) => JSX.Element | null;
|
|
6
|
+
Form: ({ formRef, customInputs, customItemRenderers, onPrimaryButtonClick, }: import("../../../types").FormProps) => JSX.Element | null;
|
|
7
7
|
AddButton: () => JSX.Element;
|
|
8
8
|
Search: () => JSX.Element;
|
|
9
9
|
Pagination: () => JSX.Element;
|
|
@@ -86,6 +86,16 @@ declare const TRANSLATION_PAIRS_WIDGET: {
|
|
|
86
86
|
tabNameRequired: string;
|
|
87
87
|
subtitle: string;
|
|
88
88
|
subTitlePlaceholder: string;
|
|
89
|
+
quote: string;
|
|
90
|
+
quotePlaceholder: string;
|
|
91
|
+
personName: string;
|
|
92
|
+
personNamePlaceholder: string;
|
|
93
|
+
personRole: string;
|
|
94
|
+
personRolePlaceholder: string;
|
|
95
|
+
personOrganization: string;
|
|
96
|
+
personOrganizationPlaceholder: string;
|
|
97
|
+
rating: string;
|
|
98
|
+
ratingPlaceholder: string;
|
|
89
99
|
altText: string;
|
|
90
100
|
altTextPlaceholder: string;
|
|
91
101
|
link: string;
|
|
@@ -2,7 +2,8 @@ import React, { MutableRefObject } from 'react';
|
|
|
2
2
|
import { DropResult } from 'react-beautiful-dnd';
|
|
3
3
|
import { FieldValues, RegisterOptions, UseFormClearErrors, UseFormGetValues, UseFormSetValue, ValidationRule } from 'react-hook-form';
|
|
4
4
|
import { Routes_Input } from './api';
|
|
5
|
-
import { OptionType, FormActionTypes, PermissionsObj, ObjectType, LanguageType } from './common';
|
|
5
|
+
import { OptionType, FormActionTypes, PermissionsObj, ObjectType, CombineObjectType, LanguageType } from './common';
|
|
6
|
+
import type { CommonTranslationPairs } from './context';
|
|
6
7
|
export interface DNDItemsListProps {
|
|
7
8
|
onDragEnd: (result: DropResult) => void;
|
|
8
9
|
items: OptionType[];
|
|
@@ -140,6 +141,7 @@ export interface FormProps {
|
|
|
140
141
|
filterQuery?: string;
|
|
141
142
|
formRef: MutableRefObject<HTMLFormElement | null>;
|
|
142
143
|
customInputs?: Record<string, (props: InputRendererProps) => JSX.Element>;
|
|
144
|
+
customItemRenderers?: Record<string, CustomItemRendererConfig>;
|
|
143
145
|
onPrimaryButtonClick?: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>, data?: any) => void;
|
|
144
146
|
}
|
|
145
147
|
export interface InputRendererProps {
|
|
@@ -148,6 +150,27 @@ export interface InputRendererProps {
|
|
|
148
150
|
setError: (msg: string) => void;
|
|
149
151
|
disabled?: boolean;
|
|
150
152
|
}
|
|
153
|
+
export interface ItemRendererProps {
|
|
154
|
+
name: string;
|
|
155
|
+
index: number;
|
|
156
|
+
itemType: 'Web' | 'Mobile';
|
|
157
|
+
errors: any;
|
|
158
|
+
control: any;
|
|
159
|
+
register: any;
|
|
160
|
+
setError: any;
|
|
161
|
+
clearError: (key: string) => void;
|
|
162
|
+
languages?: LanguageType[];
|
|
163
|
+
loading?: boolean;
|
|
164
|
+
widgetTranslations: WidgetTranslationPairs;
|
|
165
|
+
commonTranslations: CommonTranslationPairs;
|
|
166
|
+
}
|
|
167
|
+
export interface CustomItemRendererConfig {
|
|
168
|
+
render: (props: ItemRendererProps) => JSX.Element;
|
|
169
|
+
createItem?: (props: {
|
|
170
|
+
index: number;
|
|
171
|
+
itemType: 'Web' | 'Mobile';
|
|
172
|
+
}) => CombineObjectType;
|
|
173
|
+
}
|
|
151
174
|
export interface WidgetTranslationPairs {
|
|
152
175
|
htmlContentRequired: string | ValidationRule<boolean> | undefined;
|
|
153
176
|
htmlContentPlaceholder: string | undefined;
|
|
@@ -178,6 +201,16 @@ export interface WidgetTranslationPairs {
|
|
|
178
201
|
tabNameRequired: string;
|
|
179
202
|
subtitle: string;
|
|
180
203
|
subTitlePlaceholder: string;
|
|
204
|
+
quote: string;
|
|
205
|
+
quotePlaceholder: string;
|
|
206
|
+
personName: string;
|
|
207
|
+
personNamePlaceholder: string;
|
|
208
|
+
personRole: string;
|
|
209
|
+
personRolePlaceholder: string;
|
|
210
|
+
personOrganization: string;
|
|
211
|
+
personOrganizationPlaceholder: string;
|
|
212
|
+
rating: string;
|
|
213
|
+
ratingPlaceholder: string;
|
|
181
214
|
altText: string;
|
|
182
215
|
altTextPlaceholder: string;
|
|
183
216
|
link: string;
|
|
@@ -214,6 +247,7 @@ export interface WidgetProps {
|
|
|
214
247
|
imageBaseUrl?: string;
|
|
215
248
|
imageMaxSize?: number;
|
|
216
249
|
translations?: WidgetTranslationPairs;
|
|
250
|
+
customItemRenderers?: Record<string, CustomItemRendererConfig>;
|
|
217
251
|
onPrimaryButtonClick?: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>, data?: any) => void;
|
|
218
252
|
}
|
|
219
253
|
export interface DerivedTableProps {
|
|
@@ -313,6 +347,7 @@ export interface ItemsAccordianProps {
|
|
|
313
347
|
register: any;
|
|
314
348
|
setError: any;
|
|
315
349
|
clearError: (key: string) => void;
|
|
350
|
+
customItemRenderer?: CustomItemRendererConfig;
|
|
316
351
|
}
|
|
317
352
|
export interface TabItemProps {
|
|
318
353
|
showDelete?: boolean;
|