@knovator/pagecreator-admin 0.3.3 → 0.4.0
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 +104 -63
- package/index.css +3 -0
- package/index.js +104 -63
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -1712,6 +1712,7 @@ const TRANSLATION_PAIRS_WIDGET = {
|
|
|
1712
1712
|
'widget.itemsTypePlaceholder': 'Select Items Type',
|
|
1713
1713
|
'widget.widgetType': 'Widget Type',
|
|
1714
1714
|
'widget.widgetTypeRequired': 'Widget Type is required',
|
|
1715
|
+
'widget.color': 'Color',
|
|
1715
1716
|
'widget.code': 'Code',
|
|
1716
1717
|
'widget.codePlaceholder': 'Enter code',
|
|
1717
1718
|
'widget.codeRequired': 'Code is required',
|
|
@@ -1737,6 +1738,8 @@ const TRANSLATION_PAIRS_WIDGET = {
|
|
|
1737
1738
|
const TRANSLATION_PAIRS_ITEM = {
|
|
1738
1739
|
'item.title': 'Title',
|
|
1739
1740
|
'item.titlePlaceholder': 'Enter title',
|
|
1741
|
+
'item.subtitle': 'Subtitle',
|
|
1742
|
+
'item.subTitlePlaceholder': 'Enter Subtitle',
|
|
1740
1743
|
'item.altText': 'Alt Text',
|
|
1741
1744
|
'item.altTextPlaceholder': 'Enter alt text',
|
|
1742
1745
|
'item.link': 'Link',
|
|
@@ -2770,8 +2773,9 @@ const getApiType = ({
|
|
|
2770
2773
|
};
|
|
2771
2774
|
|
|
2772
2775
|
const usePage = ({
|
|
2773
|
-
defaultLimit,
|
|
2774
2776
|
routes,
|
|
2777
|
+
defaultLimit,
|
|
2778
|
+
canList: _canList = true,
|
|
2775
2779
|
preConfirmDelete
|
|
2776
2780
|
}) => {
|
|
2777
2781
|
const [list, setList] = React.useState([]);
|
|
@@ -2977,10 +2981,10 @@ const usePage = ({
|
|
|
2977
2981
|
});
|
|
2978
2982
|
};
|
|
2979
2983
|
React.useEffect(() => {
|
|
2980
|
-
getPages();
|
|
2984
|
+
if (_canList) getPages();
|
|
2981
2985
|
getWidgets();
|
|
2982
2986
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2983
|
-
}, [pageSize, currentPage]);
|
|
2987
|
+
}, [pageSize, currentPage, _canList]);
|
|
2984
2988
|
return {
|
|
2985
2989
|
list,
|
|
2986
2990
|
getPages,
|
|
@@ -3163,11 +3167,15 @@ const Table = ({
|
|
|
3163
3167
|
key: item['id'] || item['_id'] || i
|
|
3164
3168
|
}, dataKeys.map((key, j) => cellItemRenderer(item, key, j)), actions && /*#__PURE__*/React__default["default"].createElement("td", {
|
|
3165
3169
|
className: "khb_table-row-actions"
|
|
3166
|
-
}, actions.edit && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
3170
|
+
}, actions.edit && typeof actions.edit === 'function' ? /*#__PURE__*/React__default["default"].createElement("button", {
|
|
3167
3171
|
className: "khb_actions-update",
|
|
3172
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3173
|
+
// @ts-ignore
|
|
3168
3174
|
onClick: () => actions.edit(item)
|
|
3169
|
-
}, /*#__PURE__*/React__default["default"].createElement(Pencil, null)), actions.delete && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
3175
|
+
}, /*#__PURE__*/React__default["default"].createElement(Pencil, null)) : null, actions.delete && typeof actions.delete === 'function' && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
3170
3176
|
className: "khb_actions-delete",
|
|
3177
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3178
|
+
// @ts-ignore
|
|
3171
3179
|
onClick: () => actions.delete(item)
|
|
3172
3180
|
}, /*#__PURE__*/React__default["default"].createElement(Trash, null))))) : /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
|
|
3173
3181
|
colSpan: ((dataKeys === null || dataKeys === void 0 ? void 0 : dataKeys.length) || 0) + 1
|
|
@@ -3177,7 +3185,6 @@ const Table = ({
|
|
|
3177
3185
|
const PageTable = () => {
|
|
3178
3186
|
const {
|
|
3179
3187
|
list,
|
|
3180
|
-
canList,
|
|
3181
3188
|
onChangeFormState,
|
|
3182
3189
|
t,
|
|
3183
3190
|
loading,
|
|
@@ -3187,26 +3194,23 @@ const PageTable = () => {
|
|
|
3187
3194
|
} = usePageState();
|
|
3188
3195
|
const onUpdateClick = item => onChangeFormState('UPDATE', item);
|
|
3189
3196
|
const onDeleteClick = item => onChangeFormState('DELETE', item);
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
});
|
|
3208
|
-
}
|
|
3209
|
-
return null;
|
|
3197
|
+
return /*#__PURE__*/React__default["default"].createElement(Table, {
|
|
3198
|
+
data: list,
|
|
3199
|
+
loader: loader,
|
|
3200
|
+
loading: loading,
|
|
3201
|
+
dataKeys: [{
|
|
3202
|
+
label: t('page.tableName'),
|
|
3203
|
+
dataKey: 'name',
|
|
3204
|
+
highlight: true
|
|
3205
|
+
}, {
|
|
3206
|
+
label: t('page.tableCode'),
|
|
3207
|
+
dataKey: 'code'
|
|
3208
|
+
}],
|
|
3209
|
+
actions: {
|
|
3210
|
+
edit: canUpdate ? onUpdateClick : undefined,
|
|
3211
|
+
delete: canDelete ? onDeleteClick : undefined
|
|
3212
|
+
}
|
|
3213
|
+
});
|
|
3210
3214
|
};
|
|
3211
3215
|
|
|
3212
3216
|
const Checkbox = ({
|
|
@@ -3508,10 +3512,11 @@ var Input = Object.assign(Input$1, {
|
|
|
3508
3512
|
const PageSearch = () => {
|
|
3509
3513
|
const {
|
|
3510
3514
|
getPages,
|
|
3511
|
-
t
|
|
3515
|
+
t,
|
|
3516
|
+
canList
|
|
3512
3517
|
} = usePageState();
|
|
3513
3518
|
const callerRef = React.useRef(null);
|
|
3514
|
-
const [search, setSearch] = React.useState(
|
|
3519
|
+
const [search, setSearch] = React.useState('');
|
|
3515
3520
|
const onChangeSearch = str => {
|
|
3516
3521
|
setSearch(str);
|
|
3517
3522
|
if (callerRef.current) clearTimeout(callerRef.current);
|
|
@@ -3522,8 +3527,9 @@ const PageSearch = () => {
|
|
|
3522
3527
|
return /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
3523
3528
|
type: "search",
|
|
3524
3529
|
value: search,
|
|
3530
|
+
disabled: !canList,
|
|
3525
3531
|
onChange: e => onChangeSearch(e.target.value),
|
|
3526
|
-
placeholder: t(
|
|
3532
|
+
placeholder: t('page.searchPages')
|
|
3527
3533
|
});
|
|
3528
3534
|
};
|
|
3529
3535
|
|
|
@@ -3919,13 +3925,14 @@ const SimpleForm = /*#__PURE__*/React.forwardRef(({
|
|
|
3919
3925
|
case 'text':
|
|
3920
3926
|
case 'number':
|
|
3921
3927
|
case 'url':
|
|
3928
|
+
case 'color':
|
|
3922
3929
|
default:
|
|
3923
3930
|
input = /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
3924
3931
|
rest: register(schema.accessor, schema.validations || {}),
|
|
3925
3932
|
label: schema.label,
|
|
3926
3933
|
error: (_f = (_e = errors[schema.accessor]) === null || _e === void 0 ? void 0 : _e.message) === null || _f === void 0 ? void 0 : _f.toString(),
|
|
3927
3934
|
type: schema.type,
|
|
3928
|
-
className: "w-full p-2
|
|
3935
|
+
className: classNames__default["default"]('w-full p-2', schema.className),
|
|
3929
3936
|
placeholder: schema.placeholder,
|
|
3930
3937
|
disabled: _isUpdating && typeof schema.editable !== 'undefined' && !schema.editable || !_enable,
|
|
3931
3938
|
required: schema.required,
|
|
@@ -4190,7 +4197,7 @@ const Pagination = ({
|
|
|
4190
4197
|
className: "khb_pagination-total"
|
|
4191
4198
|
}, _showingText, ' ', /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4192
4199
|
className: "khb_pagination-total-showing"
|
|
4193
|
-
}, (currentPage - 1) * pageSize + 1), ' ', "-", ' ', /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4200
|
+
}, !totalRecords ? 0 : (currentPage - 1) * pageSize + 1), ' ', "-", ' ', /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4194
4201
|
className: "khb_pagination-total-showing"
|
|
4195
4202
|
}, Math.min(currentPage * pageSize, totalRecords)), ' ', _ofText, " ", totalRecords), /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
4196
4203
|
className: "khb_pagination-actions"
|
|
@@ -4211,12 +4218,13 @@ const Pagination = ({
|
|
|
4211
4218
|
id: "page",
|
|
4212
4219
|
value: localCurrentPage,
|
|
4213
4220
|
onChange: e => setLocalCurrentPage(Number(e.target.value)),
|
|
4214
|
-
onBlur: updatePagination
|
|
4221
|
+
onBlur: updatePagination,
|
|
4222
|
+
disabled: !totalRecords
|
|
4215
4223
|
}), ' ', "/ ", totalPages), /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
4216
4224
|
size: "xs",
|
|
4217
4225
|
type: "secondary",
|
|
4218
4226
|
className: "khb_pagination-next",
|
|
4219
|
-
disabled: currentPage === totalPages,
|
|
4227
|
+
disabled: currentPage === totalPages || !totalRecords,
|
|
4220
4228
|
onClick: () => onPaginationButtonClick('next')
|
|
4221
4229
|
}, nextContent || /*#__PURE__*/React__default["default"].createElement(ChevronRight, {
|
|
4222
4230
|
srText: "Next"
|
|
@@ -4472,8 +4480,12 @@ const Page = ({
|
|
|
4472
4480
|
loader,
|
|
4473
4481
|
explicitForm: _explicitForm = false,
|
|
4474
4482
|
children,
|
|
4475
|
-
|
|
4483
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4484
|
+
// @ts-ignore
|
|
4485
|
+
permissions: _permissions = {},
|
|
4486
|
+
preConfirmDelete
|
|
4476
4487
|
}) => {
|
|
4488
|
+
const derivedPermissions = Object.assign(DEFAULT_PERMISSIONS, _permissions);
|
|
4477
4489
|
const formRef = React.useRef(null);
|
|
4478
4490
|
const derivedT = createTranslation(t, Object.assign(Object.assign({}, TRANSLATION_PAIRS_COMMON), TRANSLATION_PAIRS_PAGE));
|
|
4479
4491
|
const {
|
|
@@ -4496,7 +4508,9 @@ const Page = ({
|
|
|
4496
4508
|
onChangeWidgetSequence,
|
|
4497
4509
|
getPages
|
|
4498
4510
|
} = usePage({
|
|
4499
|
-
defaultLimit: 10
|
|
4511
|
+
defaultLimit: 10,
|
|
4512
|
+
preConfirmDelete,
|
|
4513
|
+
canList: derivedPermissions.list
|
|
4500
4514
|
});
|
|
4501
4515
|
return /*#__PURE__*/React__default["default"].createElement(PageContextProvider, {
|
|
4502
4516
|
t: derivedT,
|
|
@@ -4519,10 +4533,10 @@ const Page = ({
|
|
|
4519
4533
|
formState: formState,
|
|
4520
4534
|
closeForm: onCloseForm,
|
|
4521
4535
|
// permissions
|
|
4522
|
-
canAdd:
|
|
4523
|
-
canDelete:
|
|
4524
|
-
canUpdate:
|
|
4525
|
-
canList:
|
|
4536
|
+
canAdd: derivedPermissions.add,
|
|
4537
|
+
canDelete: derivedPermissions.delete,
|
|
4538
|
+
canUpdate: derivedPermissions.update,
|
|
4539
|
+
canList: derivedPermissions.list
|
|
4526
4540
|
}, children ? children : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(AddButton$1, null), /*#__PURE__*/React__default["default"].createElement(PageSearch, null), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4527
4541
|
className: "khb_table-wrapper"
|
|
4528
4542
|
}, /*#__PURE__*/React__default["default"].createElement(PageTable, null), /*#__PURE__*/React__default["default"].createElement(PagePagination, null))), !_explicitForm && /*#__PURE__*/React__default["default"].createElement(Drawer, {
|
|
@@ -4557,6 +4571,7 @@ Page.FormActions = PageFormActions;
|
|
|
4557
4571
|
Page.FormWrapper = PageFormWrapper;
|
|
4558
4572
|
|
|
4559
4573
|
const useWidget = ({
|
|
4574
|
+
canList: _canList = true,
|
|
4560
4575
|
defaultLimit,
|
|
4561
4576
|
routes,
|
|
4562
4577
|
preConfirmDelete
|
|
@@ -4978,9 +4993,9 @@ const useWidget = ({
|
|
|
4978
4993
|
}
|
|
4979
4994
|
});
|
|
4980
4995
|
React.useEffect(() => {
|
|
4981
|
-
getWidgets();
|
|
4996
|
+
if (_canList) getWidgets();
|
|
4982
4997
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4983
|
-
}, [pageSize, currentPage]);
|
|
4998
|
+
}, [pageSize, currentPage, _canList]);
|
|
4984
4999
|
return {
|
|
4985
5000
|
list,
|
|
4986
5001
|
getWidgets,
|
|
@@ -6214,7 +6229,9 @@ const WidgetTable = () => {
|
|
|
6214
6229
|
} = useProviderState();
|
|
6215
6230
|
const {
|
|
6216
6231
|
list,
|
|
6217
|
-
|
|
6232
|
+
canUpdate,
|
|
6233
|
+
canDelete,
|
|
6234
|
+
canPartialUpdate,
|
|
6218
6235
|
onChangeFormState,
|
|
6219
6236
|
onPartialUpdateWidget,
|
|
6220
6237
|
loading,
|
|
@@ -6228,7 +6245,25 @@ const WidgetTable = () => {
|
|
|
6228
6245
|
}, [onPartialUpdateWidget]);
|
|
6229
6246
|
const onUpdateClick = item => onChangeFormState('UPDATE', item);
|
|
6230
6247
|
const onDeleteClick = item => onChangeFormState('DELETE', item);
|
|
6231
|
-
|
|
6248
|
+
const dataKeys = [{
|
|
6249
|
+
label: t('widget.tableName'),
|
|
6250
|
+
dataKey: 'name',
|
|
6251
|
+
highlight: true
|
|
6252
|
+
}, {
|
|
6253
|
+
label: t('widget.tableCode'),
|
|
6254
|
+
dataKey: 'code'
|
|
6255
|
+
}];
|
|
6256
|
+
if (canPartialUpdate) dataKeys.push({
|
|
6257
|
+
label: t('widget.tableActive'),
|
|
6258
|
+
dataKey: 'isActive',
|
|
6259
|
+
Cell: ({
|
|
6260
|
+
row
|
|
6261
|
+
}) => canPartialUpdate ? /*#__PURE__*/React__default["default"].createElement(Toggle, {
|
|
6262
|
+
switchClass: switchClass,
|
|
6263
|
+
isChecked: row === null || row === void 0 ? void 0 : row.isActive,
|
|
6264
|
+
onChange: status => updateClosure(row, 'isActive', status)
|
|
6265
|
+
}) : null
|
|
6266
|
+
});
|
|
6232
6267
|
return /*#__PURE__*/React__default["default"].createElement(Table, {
|
|
6233
6268
|
data: list,
|
|
6234
6269
|
loader: loader,
|
|
@@ -6240,20 +6275,10 @@ const WidgetTable = () => {
|
|
|
6240
6275
|
}, {
|
|
6241
6276
|
label: t('widget.tableCode'),
|
|
6242
6277
|
dataKey: 'code'
|
|
6243
|
-
}, {
|
|
6244
|
-
label: t('widget.tableActive'),
|
|
6245
|
-
dataKey: 'isActive',
|
|
6246
|
-
Cell: ({
|
|
6247
|
-
row
|
|
6248
|
-
}) => /*#__PURE__*/React__default["default"].createElement(Toggle, {
|
|
6249
|
-
switchClass: switchClass,
|
|
6250
|
-
isChecked: row === null || row === void 0 ? void 0 : row.isActive,
|
|
6251
|
-
onChange: status => updateClosure(row, 'isActive', status)
|
|
6252
|
-
})
|
|
6253
6278
|
}],
|
|
6254
6279
|
actions: {
|
|
6255
|
-
edit: onUpdateClick,
|
|
6256
|
-
delete: onDeleteClick
|
|
6280
|
+
edit: canUpdate ? onUpdateClick : false,
|
|
6281
|
+
delete: canDelete ? onDeleteClick : false
|
|
6257
6282
|
}
|
|
6258
6283
|
});
|
|
6259
6284
|
};
|
|
@@ -6754,6 +6779,11 @@ const WidgetForm = ({
|
|
|
6754
6779
|
type: 'checkbox',
|
|
6755
6780
|
show: showAutoPlay,
|
|
6756
6781
|
switchClass: switchClass
|
|
6782
|
+
}, {
|
|
6783
|
+
label: t('widget.color'),
|
|
6784
|
+
accessor: 'backgroundColor',
|
|
6785
|
+
type: 'color',
|
|
6786
|
+
className: 'khb_input-color'
|
|
6757
6787
|
}, {
|
|
6758
6788
|
label: t('widget.webPerRow'),
|
|
6759
6789
|
accessor: 'webPerRow',
|
|
@@ -6810,6 +6840,11 @@ const WidgetForm = ({
|
|
|
6810
6840
|
accessor: 'title',
|
|
6811
6841
|
type: 'text',
|
|
6812
6842
|
placeholder: t('item.titlePlaceholder')
|
|
6843
|
+
}, {
|
|
6844
|
+
label: `${t('item.subtitle')}`,
|
|
6845
|
+
accessor: 'subtitle',
|
|
6846
|
+
type: 'text',
|
|
6847
|
+
placeholder: t('item.subTitlePlaceholder')
|
|
6813
6848
|
}, {
|
|
6814
6849
|
label: `${t('item.altText')}`,
|
|
6815
6850
|
accessor: 'altText',
|
|
@@ -6952,7 +6987,8 @@ const WidgetPagination = () => {
|
|
|
6952
6987
|
const WidgetSearch = () => {
|
|
6953
6988
|
const {
|
|
6954
6989
|
getWidgets,
|
|
6955
|
-
t
|
|
6990
|
+
t,
|
|
6991
|
+
canList
|
|
6956
6992
|
} = useWidgetState();
|
|
6957
6993
|
const callerRef = React.useRef(null);
|
|
6958
6994
|
const [search, setSearch] = React.useState('');
|
|
@@ -6966,6 +7002,7 @@ const WidgetSearch = () => {
|
|
|
6966
7002
|
return /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
6967
7003
|
type: "search",
|
|
6968
7004
|
value: search,
|
|
7005
|
+
disabled: !canList,
|
|
6969
7006
|
onChange: e => onChangeSearch(e.target.value),
|
|
6970
7007
|
placeholder: t('widget.searchPlaceholder')
|
|
6971
7008
|
});
|
|
@@ -6989,7 +7026,7 @@ const WidgetFormActions = ({
|
|
|
6989
7026
|
if (!formRef) {
|
|
6990
7027
|
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is required to submit the form!`);
|
|
6991
7028
|
} else if (!formRef.current) {
|
|
6992
|
-
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is empty, make sure it's passed as '
|
|
7029
|
+
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is empty, make sure it's passed as 'formRef' prop to the form!`);
|
|
6993
7030
|
}
|
|
6994
7031
|
// formRef is provided
|
|
6995
7032
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
@@ -7027,12 +7064,15 @@ const Widget = ({
|
|
|
7027
7064
|
routes,
|
|
7028
7065
|
loader,
|
|
7029
7066
|
explicitForm: _explicitForm = false,
|
|
7030
|
-
|
|
7067
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7068
|
+
// @ts-ignore
|
|
7069
|
+
permissions: _permissions = {},
|
|
7031
7070
|
preConfirmDelete,
|
|
7032
7071
|
formatListItem,
|
|
7033
7072
|
formatOptionLabel,
|
|
7034
7073
|
children
|
|
7035
7074
|
}) => {
|
|
7075
|
+
const derivedPermissions = Object.assign(DEFAULT_PERMISSIONS, _permissions);
|
|
7036
7076
|
const widgetFormRef = React.useRef(null);
|
|
7037
7077
|
const derivedT = createTranslation(t, Object.assign(Object.assign(Object.assign({}, TRANSLATION_PAIRS_COMMON), TRANSLATION_PAIRS_WIDGET), TRANSLATION_PAIRS_ITEM));
|
|
7038
7078
|
const {
|
|
@@ -7065,6 +7105,7 @@ const Widget = ({
|
|
|
7065
7105
|
itemsLoading,
|
|
7066
7106
|
onItemFormSubmit
|
|
7067
7107
|
} = useWidget({
|
|
7108
|
+
canList: derivedPermissions.list,
|
|
7068
7109
|
routes,
|
|
7069
7110
|
defaultLimit: 10,
|
|
7070
7111
|
preConfirmDelete
|
|
@@ -7101,11 +7142,11 @@ const Widget = ({
|
|
|
7101
7142
|
itemsLoading: itemsLoading,
|
|
7102
7143
|
onItemFormSubmit: onItemFormSubmit,
|
|
7103
7144
|
// Permissions
|
|
7104
|
-
canAdd:
|
|
7105
|
-
canDelete:
|
|
7106
|
-
canList:
|
|
7107
|
-
canUpdate:
|
|
7108
|
-
canPartialUpdate:
|
|
7145
|
+
canAdd: derivedPermissions.add,
|
|
7146
|
+
canDelete: derivedPermissions.delete,
|
|
7147
|
+
canList: derivedPermissions.list,
|
|
7148
|
+
canUpdate: derivedPermissions.update,
|
|
7149
|
+
canPartialUpdate: derivedPermissions.partialUpdate,
|
|
7109
7150
|
formState: formState,
|
|
7110
7151
|
closeForm: onCloseForm
|
|
7111
7152
|
}, children ? children : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(AddButton, null), /*#__PURE__*/React__default["default"].createElement(WidgetSearch, null), /*#__PURE__*/React__default["default"].createElement("div", {
|
package/index.css
CHANGED
|
@@ -1522,6 +1522,9 @@ video {
|
|
|
1522
1522
|
margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
|
|
1523
1523
|
margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
|
|
1524
1524
|
}
|
|
1525
|
+
.khb_input-color {
|
|
1526
|
+
height: 3.5rem;
|
|
1527
|
+
}
|
|
1525
1528
|
/* \ End of Input */
|
|
1526
1529
|
|
|
1527
1530
|
/* Drawer */
|
package/index.js
CHANGED
|
@@ -1700,6 +1700,7 @@ const TRANSLATION_PAIRS_WIDGET = {
|
|
|
1700
1700
|
'widget.itemsTypePlaceholder': 'Select Items Type',
|
|
1701
1701
|
'widget.widgetType': 'Widget Type',
|
|
1702
1702
|
'widget.widgetTypeRequired': 'Widget Type is required',
|
|
1703
|
+
'widget.color': 'Color',
|
|
1703
1704
|
'widget.code': 'Code',
|
|
1704
1705
|
'widget.codePlaceholder': 'Enter code',
|
|
1705
1706
|
'widget.codeRequired': 'Code is required',
|
|
@@ -1725,6 +1726,8 @@ const TRANSLATION_PAIRS_WIDGET = {
|
|
|
1725
1726
|
const TRANSLATION_PAIRS_ITEM = {
|
|
1726
1727
|
'item.title': 'Title',
|
|
1727
1728
|
'item.titlePlaceholder': 'Enter title',
|
|
1729
|
+
'item.subtitle': 'Subtitle',
|
|
1730
|
+
'item.subTitlePlaceholder': 'Enter Subtitle',
|
|
1728
1731
|
'item.altText': 'Alt Text',
|
|
1729
1732
|
'item.altTextPlaceholder': 'Enter alt text',
|
|
1730
1733
|
'item.link': 'Link',
|
|
@@ -2758,8 +2761,9 @@ const getApiType = ({
|
|
|
2758
2761
|
};
|
|
2759
2762
|
|
|
2760
2763
|
const usePage = ({
|
|
2761
|
-
defaultLimit,
|
|
2762
2764
|
routes,
|
|
2765
|
+
defaultLimit,
|
|
2766
|
+
canList: _canList = true,
|
|
2763
2767
|
preConfirmDelete
|
|
2764
2768
|
}) => {
|
|
2765
2769
|
const [list, setList] = useState([]);
|
|
@@ -2965,10 +2969,10 @@ const usePage = ({
|
|
|
2965
2969
|
});
|
|
2966
2970
|
};
|
|
2967
2971
|
useEffect(() => {
|
|
2968
|
-
getPages();
|
|
2972
|
+
if (_canList) getPages();
|
|
2969
2973
|
getWidgets();
|
|
2970
2974
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2971
|
-
}, [pageSize, currentPage]);
|
|
2975
|
+
}, [pageSize, currentPage, _canList]);
|
|
2972
2976
|
return {
|
|
2973
2977
|
list,
|
|
2974
2978
|
getPages,
|
|
@@ -3151,11 +3155,15 @@ const Table = ({
|
|
|
3151
3155
|
key: item['id'] || item['_id'] || i
|
|
3152
3156
|
}, dataKeys.map((key, j) => cellItemRenderer(item, key, j)), actions && /*#__PURE__*/React.createElement("td", {
|
|
3153
3157
|
className: "khb_table-row-actions"
|
|
3154
|
-
}, actions.edit && /*#__PURE__*/React.createElement("button", {
|
|
3158
|
+
}, actions.edit && typeof actions.edit === 'function' ? /*#__PURE__*/React.createElement("button", {
|
|
3155
3159
|
className: "khb_actions-update",
|
|
3160
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3161
|
+
// @ts-ignore
|
|
3156
3162
|
onClick: () => actions.edit(item)
|
|
3157
|
-
}, /*#__PURE__*/React.createElement(Pencil, null)), actions.delete && /*#__PURE__*/React.createElement("button", {
|
|
3163
|
+
}, /*#__PURE__*/React.createElement(Pencil, null)) : null, actions.delete && typeof actions.delete === 'function' && /*#__PURE__*/React.createElement("button", {
|
|
3158
3164
|
className: "khb_actions-delete",
|
|
3165
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3166
|
+
// @ts-ignore
|
|
3159
3167
|
onClick: () => actions.delete(item)
|
|
3160
3168
|
}, /*#__PURE__*/React.createElement(Trash, null))))) : /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
3161
3169
|
colSpan: ((dataKeys === null || dataKeys === void 0 ? void 0 : dataKeys.length) || 0) + 1
|
|
@@ -3165,7 +3173,6 @@ const Table = ({
|
|
|
3165
3173
|
const PageTable = () => {
|
|
3166
3174
|
const {
|
|
3167
3175
|
list,
|
|
3168
|
-
canList,
|
|
3169
3176
|
onChangeFormState,
|
|
3170
3177
|
t,
|
|
3171
3178
|
loading,
|
|
@@ -3175,26 +3182,23 @@ const PageTable = () => {
|
|
|
3175
3182
|
} = usePageState();
|
|
3176
3183
|
const onUpdateClick = item => onChangeFormState('UPDATE', item);
|
|
3177
3184
|
const onDeleteClick = item => onChangeFormState('DELETE', item);
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
});
|
|
3196
|
-
}
|
|
3197
|
-
return null;
|
|
3185
|
+
return /*#__PURE__*/React.createElement(Table, {
|
|
3186
|
+
data: list,
|
|
3187
|
+
loader: loader,
|
|
3188
|
+
loading: loading,
|
|
3189
|
+
dataKeys: [{
|
|
3190
|
+
label: t('page.tableName'),
|
|
3191
|
+
dataKey: 'name',
|
|
3192
|
+
highlight: true
|
|
3193
|
+
}, {
|
|
3194
|
+
label: t('page.tableCode'),
|
|
3195
|
+
dataKey: 'code'
|
|
3196
|
+
}],
|
|
3197
|
+
actions: {
|
|
3198
|
+
edit: canUpdate ? onUpdateClick : undefined,
|
|
3199
|
+
delete: canDelete ? onDeleteClick : undefined
|
|
3200
|
+
}
|
|
3201
|
+
});
|
|
3198
3202
|
};
|
|
3199
3203
|
|
|
3200
3204
|
const Checkbox = ({
|
|
@@ -3496,10 +3500,11 @@ var Input = Object.assign(Input$1, {
|
|
|
3496
3500
|
const PageSearch = () => {
|
|
3497
3501
|
const {
|
|
3498
3502
|
getPages,
|
|
3499
|
-
t
|
|
3503
|
+
t,
|
|
3504
|
+
canList
|
|
3500
3505
|
} = usePageState();
|
|
3501
3506
|
const callerRef = useRef(null);
|
|
3502
|
-
const [search, setSearch] = useState(
|
|
3507
|
+
const [search, setSearch] = useState('');
|
|
3503
3508
|
const onChangeSearch = str => {
|
|
3504
3509
|
setSearch(str);
|
|
3505
3510
|
if (callerRef.current) clearTimeout(callerRef.current);
|
|
@@ -3510,8 +3515,9 @@ const PageSearch = () => {
|
|
|
3510
3515
|
return /*#__PURE__*/React.createElement(Input, {
|
|
3511
3516
|
type: "search",
|
|
3512
3517
|
value: search,
|
|
3518
|
+
disabled: !canList,
|
|
3513
3519
|
onChange: e => onChangeSearch(e.target.value),
|
|
3514
|
-
placeholder: t(
|
|
3520
|
+
placeholder: t('page.searchPages')
|
|
3515
3521
|
});
|
|
3516
3522
|
};
|
|
3517
3523
|
|
|
@@ -3907,13 +3913,14 @@ const SimpleForm = /*#__PURE__*/forwardRef(({
|
|
|
3907
3913
|
case 'text':
|
|
3908
3914
|
case 'number':
|
|
3909
3915
|
case 'url':
|
|
3916
|
+
case 'color':
|
|
3910
3917
|
default:
|
|
3911
3918
|
input = /*#__PURE__*/React.createElement(Input, {
|
|
3912
3919
|
rest: register(schema.accessor, schema.validations || {}),
|
|
3913
3920
|
label: schema.label,
|
|
3914
3921
|
error: (_f = (_e = errors[schema.accessor]) === null || _e === void 0 ? void 0 : _e.message) === null || _f === void 0 ? void 0 : _f.toString(),
|
|
3915
3922
|
type: schema.type,
|
|
3916
|
-
className:
|
|
3923
|
+
className: classNames('w-full p-2', schema.className),
|
|
3917
3924
|
placeholder: schema.placeholder,
|
|
3918
3925
|
disabled: _isUpdating && typeof schema.editable !== 'undefined' && !schema.editable || !_enable,
|
|
3919
3926
|
required: schema.required,
|
|
@@ -4178,7 +4185,7 @@ const Pagination = ({
|
|
|
4178
4185
|
className: "khb_pagination-total"
|
|
4179
4186
|
}, _showingText, ' ', /*#__PURE__*/React.createElement("span", {
|
|
4180
4187
|
className: "khb_pagination-total-showing"
|
|
4181
|
-
}, (currentPage - 1) * pageSize + 1), ' ', "-", ' ', /*#__PURE__*/React.createElement("span", {
|
|
4188
|
+
}, !totalRecords ? 0 : (currentPage - 1) * pageSize + 1), ' ', "-", ' ', /*#__PURE__*/React.createElement("span", {
|
|
4182
4189
|
className: "khb_pagination-total-showing"
|
|
4183
4190
|
}, Math.min(currentPage * pageSize, totalRecords)), ' ', _ofText, " ", totalRecords), /*#__PURE__*/React.createElement("ul", {
|
|
4184
4191
|
className: "khb_pagination-actions"
|
|
@@ -4199,12 +4206,13 @@ const Pagination = ({
|
|
|
4199
4206
|
id: "page",
|
|
4200
4207
|
value: localCurrentPage,
|
|
4201
4208
|
onChange: e => setLocalCurrentPage(Number(e.target.value)),
|
|
4202
|
-
onBlur: updatePagination
|
|
4209
|
+
onBlur: updatePagination,
|
|
4210
|
+
disabled: !totalRecords
|
|
4203
4211
|
}), ' ', "/ ", totalPages), /*#__PURE__*/React.createElement(Button, {
|
|
4204
4212
|
size: "xs",
|
|
4205
4213
|
type: "secondary",
|
|
4206
4214
|
className: "khb_pagination-next",
|
|
4207
|
-
disabled: currentPage === totalPages,
|
|
4215
|
+
disabled: currentPage === totalPages || !totalRecords,
|
|
4208
4216
|
onClick: () => onPaginationButtonClick('next')
|
|
4209
4217
|
}, nextContent || /*#__PURE__*/React.createElement(ChevronRight, {
|
|
4210
4218
|
srText: "Next"
|
|
@@ -4460,8 +4468,12 @@ const Page = ({
|
|
|
4460
4468
|
loader,
|
|
4461
4469
|
explicitForm: _explicitForm = false,
|
|
4462
4470
|
children,
|
|
4463
|
-
|
|
4471
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4472
|
+
// @ts-ignore
|
|
4473
|
+
permissions: _permissions = {},
|
|
4474
|
+
preConfirmDelete
|
|
4464
4475
|
}) => {
|
|
4476
|
+
const derivedPermissions = Object.assign(DEFAULT_PERMISSIONS, _permissions);
|
|
4465
4477
|
const formRef = useRef(null);
|
|
4466
4478
|
const derivedT = createTranslation(t, Object.assign(Object.assign({}, TRANSLATION_PAIRS_COMMON), TRANSLATION_PAIRS_PAGE));
|
|
4467
4479
|
const {
|
|
@@ -4484,7 +4496,9 @@ const Page = ({
|
|
|
4484
4496
|
onChangeWidgetSequence,
|
|
4485
4497
|
getPages
|
|
4486
4498
|
} = usePage({
|
|
4487
|
-
defaultLimit: 10
|
|
4499
|
+
defaultLimit: 10,
|
|
4500
|
+
preConfirmDelete,
|
|
4501
|
+
canList: derivedPermissions.list
|
|
4488
4502
|
});
|
|
4489
4503
|
return /*#__PURE__*/React.createElement(PageContextProvider, {
|
|
4490
4504
|
t: derivedT,
|
|
@@ -4507,10 +4521,10 @@ const Page = ({
|
|
|
4507
4521
|
formState: formState,
|
|
4508
4522
|
closeForm: onCloseForm,
|
|
4509
4523
|
// permissions
|
|
4510
|
-
canAdd:
|
|
4511
|
-
canDelete:
|
|
4512
|
-
canUpdate:
|
|
4513
|
-
canList:
|
|
4524
|
+
canAdd: derivedPermissions.add,
|
|
4525
|
+
canDelete: derivedPermissions.delete,
|
|
4526
|
+
canUpdate: derivedPermissions.update,
|
|
4527
|
+
canList: derivedPermissions.list
|
|
4514
4528
|
}, children ? children : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AddButton$1, null), /*#__PURE__*/React.createElement(PageSearch, null), /*#__PURE__*/React.createElement("div", {
|
|
4515
4529
|
className: "khb_table-wrapper"
|
|
4516
4530
|
}, /*#__PURE__*/React.createElement(PageTable, null), /*#__PURE__*/React.createElement(PagePagination, null))), !_explicitForm && /*#__PURE__*/React.createElement(Drawer, {
|
|
@@ -4545,6 +4559,7 @@ Page.FormActions = PageFormActions;
|
|
|
4545
4559
|
Page.FormWrapper = PageFormWrapper;
|
|
4546
4560
|
|
|
4547
4561
|
const useWidget = ({
|
|
4562
|
+
canList: _canList = true,
|
|
4548
4563
|
defaultLimit,
|
|
4549
4564
|
routes,
|
|
4550
4565
|
preConfirmDelete
|
|
@@ -4966,9 +4981,9 @@ const useWidget = ({
|
|
|
4966
4981
|
}
|
|
4967
4982
|
});
|
|
4968
4983
|
useEffect(() => {
|
|
4969
|
-
getWidgets();
|
|
4984
|
+
if (_canList) getWidgets();
|
|
4970
4985
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4971
|
-
}, [pageSize, currentPage]);
|
|
4986
|
+
}, [pageSize, currentPage, _canList]);
|
|
4972
4987
|
return {
|
|
4973
4988
|
list,
|
|
4974
4989
|
getWidgets,
|
|
@@ -6202,7 +6217,9 @@ const WidgetTable = () => {
|
|
|
6202
6217
|
} = useProviderState();
|
|
6203
6218
|
const {
|
|
6204
6219
|
list,
|
|
6205
|
-
|
|
6220
|
+
canUpdate,
|
|
6221
|
+
canDelete,
|
|
6222
|
+
canPartialUpdate,
|
|
6206
6223
|
onChangeFormState,
|
|
6207
6224
|
onPartialUpdateWidget,
|
|
6208
6225
|
loading,
|
|
@@ -6216,7 +6233,25 @@ const WidgetTable = () => {
|
|
|
6216
6233
|
}, [onPartialUpdateWidget]);
|
|
6217
6234
|
const onUpdateClick = item => onChangeFormState('UPDATE', item);
|
|
6218
6235
|
const onDeleteClick = item => onChangeFormState('DELETE', item);
|
|
6219
|
-
|
|
6236
|
+
const dataKeys = [{
|
|
6237
|
+
label: t('widget.tableName'),
|
|
6238
|
+
dataKey: 'name',
|
|
6239
|
+
highlight: true
|
|
6240
|
+
}, {
|
|
6241
|
+
label: t('widget.tableCode'),
|
|
6242
|
+
dataKey: 'code'
|
|
6243
|
+
}];
|
|
6244
|
+
if (canPartialUpdate) dataKeys.push({
|
|
6245
|
+
label: t('widget.tableActive'),
|
|
6246
|
+
dataKey: 'isActive',
|
|
6247
|
+
Cell: ({
|
|
6248
|
+
row
|
|
6249
|
+
}) => canPartialUpdate ? /*#__PURE__*/React.createElement(Toggle, {
|
|
6250
|
+
switchClass: switchClass,
|
|
6251
|
+
isChecked: row === null || row === void 0 ? void 0 : row.isActive,
|
|
6252
|
+
onChange: status => updateClosure(row, 'isActive', status)
|
|
6253
|
+
}) : null
|
|
6254
|
+
});
|
|
6220
6255
|
return /*#__PURE__*/React.createElement(Table, {
|
|
6221
6256
|
data: list,
|
|
6222
6257
|
loader: loader,
|
|
@@ -6228,20 +6263,10 @@ const WidgetTable = () => {
|
|
|
6228
6263
|
}, {
|
|
6229
6264
|
label: t('widget.tableCode'),
|
|
6230
6265
|
dataKey: 'code'
|
|
6231
|
-
}, {
|
|
6232
|
-
label: t('widget.tableActive'),
|
|
6233
|
-
dataKey: 'isActive',
|
|
6234
|
-
Cell: ({
|
|
6235
|
-
row
|
|
6236
|
-
}) => /*#__PURE__*/React.createElement(Toggle, {
|
|
6237
|
-
switchClass: switchClass,
|
|
6238
|
-
isChecked: row === null || row === void 0 ? void 0 : row.isActive,
|
|
6239
|
-
onChange: status => updateClosure(row, 'isActive', status)
|
|
6240
|
-
})
|
|
6241
6266
|
}],
|
|
6242
6267
|
actions: {
|
|
6243
|
-
edit: onUpdateClick,
|
|
6244
|
-
delete: onDeleteClick
|
|
6268
|
+
edit: canUpdate ? onUpdateClick : false,
|
|
6269
|
+
delete: canDelete ? onDeleteClick : false
|
|
6245
6270
|
}
|
|
6246
6271
|
});
|
|
6247
6272
|
};
|
|
@@ -6742,6 +6767,11 @@ const WidgetForm = ({
|
|
|
6742
6767
|
type: 'checkbox',
|
|
6743
6768
|
show: showAutoPlay,
|
|
6744
6769
|
switchClass: switchClass
|
|
6770
|
+
}, {
|
|
6771
|
+
label: t('widget.color'),
|
|
6772
|
+
accessor: 'backgroundColor',
|
|
6773
|
+
type: 'color',
|
|
6774
|
+
className: 'khb_input-color'
|
|
6745
6775
|
}, {
|
|
6746
6776
|
label: t('widget.webPerRow'),
|
|
6747
6777
|
accessor: 'webPerRow',
|
|
@@ -6798,6 +6828,11 @@ const WidgetForm = ({
|
|
|
6798
6828
|
accessor: 'title',
|
|
6799
6829
|
type: 'text',
|
|
6800
6830
|
placeholder: t('item.titlePlaceholder')
|
|
6831
|
+
}, {
|
|
6832
|
+
label: `${t('item.subtitle')}`,
|
|
6833
|
+
accessor: 'subtitle',
|
|
6834
|
+
type: 'text',
|
|
6835
|
+
placeholder: t('item.subTitlePlaceholder')
|
|
6801
6836
|
}, {
|
|
6802
6837
|
label: `${t('item.altText')}`,
|
|
6803
6838
|
accessor: 'altText',
|
|
@@ -6940,7 +6975,8 @@ const WidgetPagination = () => {
|
|
|
6940
6975
|
const WidgetSearch = () => {
|
|
6941
6976
|
const {
|
|
6942
6977
|
getWidgets,
|
|
6943
|
-
t
|
|
6978
|
+
t,
|
|
6979
|
+
canList
|
|
6944
6980
|
} = useWidgetState();
|
|
6945
6981
|
const callerRef = useRef(null);
|
|
6946
6982
|
const [search, setSearch] = useState('');
|
|
@@ -6954,6 +6990,7 @@ const WidgetSearch = () => {
|
|
|
6954
6990
|
return /*#__PURE__*/React.createElement(Input, {
|
|
6955
6991
|
type: "search",
|
|
6956
6992
|
value: search,
|
|
6993
|
+
disabled: !canList,
|
|
6957
6994
|
onChange: e => onChangeSearch(e.target.value),
|
|
6958
6995
|
placeholder: t('widget.searchPlaceholder')
|
|
6959
6996
|
});
|
|
@@ -6977,7 +7014,7 @@ const WidgetFormActions = ({
|
|
|
6977
7014
|
if (!formRef) {
|
|
6978
7015
|
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is required to submit the form!`);
|
|
6979
7016
|
} else if (!formRef.current) {
|
|
6980
|
-
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is empty, make sure it's passed as '
|
|
7017
|
+
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is empty, make sure it's passed as 'formRef' prop to the form!`);
|
|
6981
7018
|
}
|
|
6982
7019
|
// formRef is provided
|
|
6983
7020
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
@@ -7015,12 +7052,15 @@ const Widget = ({
|
|
|
7015
7052
|
routes,
|
|
7016
7053
|
loader,
|
|
7017
7054
|
explicitForm: _explicitForm = false,
|
|
7018
|
-
|
|
7055
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7056
|
+
// @ts-ignore
|
|
7057
|
+
permissions: _permissions = {},
|
|
7019
7058
|
preConfirmDelete,
|
|
7020
7059
|
formatListItem,
|
|
7021
7060
|
formatOptionLabel,
|
|
7022
7061
|
children
|
|
7023
7062
|
}) => {
|
|
7063
|
+
const derivedPermissions = Object.assign(DEFAULT_PERMISSIONS, _permissions);
|
|
7024
7064
|
const widgetFormRef = useRef(null);
|
|
7025
7065
|
const derivedT = createTranslation(t, Object.assign(Object.assign(Object.assign({}, TRANSLATION_PAIRS_COMMON), TRANSLATION_PAIRS_WIDGET), TRANSLATION_PAIRS_ITEM));
|
|
7026
7066
|
const {
|
|
@@ -7053,6 +7093,7 @@ const Widget = ({
|
|
|
7053
7093
|
itemsLoading,
|
|
7054
7094
|
onItemFormSubmit
|
|
7055
7095
|
} = useWidget({
|
|
7096
|
+
canList: derivedPermissions.list,
|
|
7056
7097
|
routes,
|
|
7057
7098
|
defaultLimit: 10,
|
|
7058
7099
|
preConfirmDelete
|
|
@@ -7089,11 +7130,11 @@ const Widget = ({
|
|
|
7089
7130
|
itemsLoading: itemsLoading,
|
|
7090
7131
|
onItemFormSubmit: onItemFormSubmit,
|
|
7091
7132
|
// Permissions
|
|
7092
|
-
canAdd:
|
|
7093
|
-
canDelete:
|
|
7094
|
-
canList:
|
|
7095
|
-
canUpdate:
|
|
7096
|
-
canPartialUpdate:
|
|
7133
|
+
canAdd: derivedPermissions.add,
|
|
7134
|
+
canDelete: derivedPermissions.delete,
|
|
7135
|
+
canList: derivedPermissions.list,
|
|
7136
|
+
canUpdate: derivedPermissions.update,
|
|
7137
|
+
canPartialUpdate: derivedPermissions.partialUpdate,
|
|
7097
7138
|
formState: formState,
|
|
7098
7139
|
closeForm: onCloseForm
|
|
7099
7140
|
}, children ? children : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AddButton, null), /*#__PURE__*/React.createElement(WidgetSearch, null), /*#__PURE__*/React.createElement("div", {
|