@knovator/pagecreator-admin 0.9.0 → 0.9.2
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 +33 -3
- package/index.js +33 -3
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -3820,7 +3820,37 @@ const SimpleForm = /*#__PURE__*/React.forwardRef(({
|
|
|
3820
3820
|
break;
|
|
3821
3821
|
}
|
|
3822
3822
|
} else if (schema.Input) {
|
|
3823
|
-
|
|
3823
|
+
if (Array.isArray(languages) && languages.length > 0 && schema.accessor === 'widgetTitles') {
|
|
3824
|
+
input = languages.map(lang => /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3825
|
+
key: lang.code,
|
|
3826
|
+
className: classNames__default["default"]('khb_input-wrapper', schema.wrapperClassName)
|
|
3827
|
+
}, /*#__PURE__*/React__default["default"].createElement("label", {
|
|
3828
|
+
className: "khb_input-label"
|
|
3829
|
+
}, schema.label, " (", lang.name, ")", schema.required ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3830
|
+
className: "khb_input-label-required"
|
|
3831
|
+
}, "*") : null), /*#__PURE__*/React__default["default"].createElement(reactHookForm.Controller, {
|
|
3832
|
+
control: control,
|
|
3833
|
+
name: `${schema.accessor}.${lang.code}`,
|
|
3834
|
+
rules: schema.validations,
|
|
3835
|
+
render: ({
|
|
3836
|
+
field
|
|
3837
|
+
}) => {
|
|
3838
|
+
var _a, _b, _c;
|
|
3839
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3840
|
+
return schema.Input({
|
|
3841
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3842
|
+
// @ts-ignore
|
|
3843
|
+
field,
|
|
3844
|
+
error: (_c = (_b = (_a = errors[schema.accessor]) === null || _a === void 0 ? void 0 : _a[lang.code]) === null || _b === void 0 ? void 0 : _b.message) === null || _c === void 0 ? void 0 : _c.toString(),
|
|
3845
|
+
disabled: _isUpdating && typeof schema.editable !== 'undefined' && !schema.editable || !_enable,
|
|
3846
|
+
setError: msg => setError.call(null, schema.accessor, {
|
|
3847
|
+
type: 'custom',
|
|
3848
|
+
message: msg
|
|
3849
|
+
})
|
|
3850
|
+
});
|
|
3851
|
+
}
|
|
3852
|
+
})));
|
|
3853
|
+
} else input = /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3824
3854
|
className: classNames__default["default"]('khb_input-wrapper', schema.wrapperClassName)
|
|
3825
3855
|
}, schema.label && /*#__PURE__*/React__default["default"].createElement("label", {
|
|
3826
3856
|
className: "khb_input-label"
|
|
@@ -7148,14 +7178,14 @@ const WidgetForm = ({
|
|
|
7148
7178
|
label: `${t('widget.widgetTitle')}`,
|
|
7149
7179
|
accessor: 'widgetTitles',
|
|
7150
7180
|
required: true,
|
|
7151
|
-
type: customInputs && customInputs['
|
|
7181
|
+
type: customInputs && customInputs['widgetTitles'] ? undefined : 'text',
|
|
7152
7182
|
validations: {
|
|
7153
7183
|
required: t('widget.widgetTitleRequired')
|
|
7154
7184
|
},
|
|
7155
7185
|
info: t('widget.widgetTitleInfo'),
|
|
7156
7186
|
placeholder: t('widget.widgetTitlePlaceholder'),
|
|
7157
7187
|
onInput: handleCapitalize,
|
|
7158
|
-
Input: customInputs && customInputs['
|
|
7188
|
+
Input: customInputs && customInputs['widgetTitles'] ? customInputs['widgetTitles'] : undefined
|
|
7159
7189
|
} : {
|
|
7160
7190
|
label: `${t('widget.widgetTitle')}`,
|
|
7161
7191
|
accessor: 'widgetTitle',
|
package/index.js
CHANGED
|
@@ -3808,7 +3808,37 @@ const SimpleForm = /*#__PURE__*/forwardRef(({
|
|
|
3808
3808
|
break;
|
|
3809
3809
|
}
|
|
3810
3810
|
} else if (schema.Input) {
|
|
3811
|
-
|
|
3811
|
+
if (Array.isArray(languages) && languages.length > 0 && schema.accessor === 'widgetTitles') {
|
|
3812
|
+
input = languages.map(lang => /*#__PURE__*/React.createElement("div", {
|
|
3813
|
+
key: lang.code,
|
|
3814
|
+
className: classNames('khb_input-wrapper', schema.wrapperClassName)
|
|
3815
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
3816
|
+
className: "khb_input-label"
|
|
3817
|
+
}, schema.label, " (", lang.name, ")", schema.required ? /*#__PURE__*/React.createElement("span", {
|
|
3818
|
+
className: "khb_input-label-required"
|
|
3819
|
+
}, "*") : null), /*#__PURE__*/React.createElement(Controller, {
|
|
3820
|
+
control: control,
|
|
3821
|
+
name: `${schema.accessor}.${lang.code}`,
|
|
3822
|
+
rules: schema.validations,
|
|
3823
|
+
render: ({
|
|
3824
|
+
field
|
|
3825
|
+
}) => {
|
|
3826
|
+
var _a, _b, _c;
|
|
3827
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3828
|
+
return schema.Input({
|
|
3829
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3830
|
+
// @ts-ignore
|
|
3831
|
+
field,
|
|
3832
|
+
error: (_c = (_b = (_a = errors[schema.accessor]) === null || _a === void 0 ? void 0 : _a[lang.code]) === null || _b === void 0 ? void 0 : _b.message) === null || _c === void 0 ? void 0 : _c.toString(),
|
|
3833
|
+
disabled: _isUpdating && typeof schema.editable !== 'undefined' && !schema.editable || !_enable,
|
|
3834
|
+
setError: msg => setError.call(null, schema.accessor, {
|
|
3835
|
+
type: 'custom',
|
|
3836
|
+
message: msg
|
|
3837
|
+
})
|
|
3838
|
+
});
|
|
3839
|
+
}
|
|
3840
|
+
})));
|
|
3841
|
+
} else input = /*#__PURE__*/React.createElement("div", {
|
|
3812
3842
|
className: classNames('khb_input-wrapper', schema.wrapperClassName)
|
|
3813
3843
|
}, schema.label && /*#__PURE__*/React.createElement("label", {
|
|
3814
3844
|
className: "khb_input-label"
|
|
@@ -7136,14 +7166,14 @@ const WidgetForm = ({
|
|
|
7136
7166
|
label: `${t('widget.widgetTitle')}`,
|
|
7137
7167
|
accessor: 'widgetTitles',
|
|
7138
7168
|
required: true,
|
|
7139
|
-
type: customInputs && customInputs['
|
|
7169
|
+
type: customInputs && customInputs['widgetTitles'] ? undefined : 'text',
|
|
7140
7170
|
validations: {
|
|
7141
7171
|
required: t('widget.widgetTitleRequired')
|
|
7142
7172
|
},
|
|
7143
7173
|
info: t('widget.widgetTitleInfo'),
|
|
7144
7174
|
placeholder: t('widget.widgetTitlePlaceholder'),
|
|
7145
7175
|
onInput: handleCapitalize,
|
|
7146
|
-
Input: customInputs && customInputs['
|
|
7176
|
+
Input: customInputs && customInputs['widgetTitles'] ? customInputs['widgetTitles'] : undefined
|
|
7147
7177
|
} : {
|
|
7148
7178
|
label: `${t('widget.widgetTitle')}`,
|
|
7149
7179
|
accessor: 'widgetTitle',
|