@knovator/pagecreator-admin 0.3.3 → 0.4.1
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 +105 -71
- package/index.css +3 -0
- package/index.js +105 -71
- 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,32 +6245,33 @@ 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,
|
|
6235
6270
|
loading: loading,
|
|
6236
|
-
dataKeys:
|
|
6237
|
-
label: t('widget.tableName'),
|
|
6238
|
-
dataKey: 'name',
|
|
6239
|
-
highlight: true
|
|
6240
|
-
}, {
|
|
6241
|
-
label: t('widget.tableCode'),
|
|
6242
|
-
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
|
-
}],
|
|
6271
|
+
dataKeys: dataKeys,
|
|
6254
6272
|
actions: {
|
|
6255
|
-
edit: onUpdateClick,
|
|
6256
|
-
delete: onDeleteClick
|
|
6273
|
+
edit: canUpdate ? onUpdateClick : false,
|
|
6274
|
+
delete: canDelete ? onDeleteClick : false
|
|
6257
6275
|
}
|
|
6258
6276
|
});
|
|
6259
6277
|
};
|
|
@@ -6754,6 +6772,11 @@ const WidgetForm = ({
|
|
|
6754
6772
|
type: 'checkbox',
|
|
6755
6773
|
show: showAutoPlay,
|
|
6756
6774
|
switchClass: switchClass
|
|
6775
|
+
}, {
|
|
6776
|
+
label: t('widget.color'),
|
|
6777
|
+
accessor: 'backgroundColor',
|
|
6778
|
+
type: 'color',
|
|
6779
|
+
className: 'khb_input-color'
|
|
6757
6780
|
}, {
|
|
6758
6781
|
label: t('widget.webPerRow'),
|
|
6759
6782
|
accessor: 'webPerRow',
|
|
@@ -6810,6 +6833,11 @@ const WidgetForm = ({
|
|
|
6810
6833
|
accessor: 'title',
|
|
6811
6834
|
type: 'text',
|
|
6812
6835
|
placeholder: t('item.titlePlaceholder')
|
|
6836
|
+
}, {
|
|
6837
|
+
label: `${t('item.subtitle')}`,
|
|
6838
|
+
accessor: 'subtitle',
|
|
6839
|
+
type: 'text',
|
|
6840
|
+
placeholder: t('item.subTitlePlaceholder')
|
|
6813
6841
|
}, {
|
|
6814
6842
|
label: `${t('item.altText')}`,
|
|
6815
6843
|
accessor: 'altText',
|
|
@@ -6952,7 +6980,8 @@ const WidgetPagination = () => {
|
|
|
6952
6980
|
const WidgetSearch = () => {
|
|
6953
6981
|
const {
|
|
6954
6982
|
getWidgets,
|
|
6955
|
-
t
|
|
6983
|
+
t,
|
|
6984
|
+
canList
|
|
6956
6985
|
} = useWidgetState();
|
|
6957
6986
|
const callerRef = React.useRef(null);
|
|
6958
6987
|
const [search, setSearch] = React.useState('');
|
|
@@ -6966,6 +6995,7 @@ const WidgetSearch = () => {
|
|
|
6966
6995
|
return /*#__PURE__*/React__default["default"].createElement(Input, {
|
|
6967
6996
|
type: "search",
|
|
6968
6997
|
value: search,
|
|
6998
|
+
disabled: !canList,
|
|
6969
6999
|
onChange: e => onChangeSearch(e.target.value),
|
|
6970
7000
|
placeholder: t('widget.searchPlaceholder')
|
|
6971
7001
|
});
|
|
@@ -6989,7 +7019,7 @@ const WidgetFormActions = ({
|
|
|
6989
7019
|
if (!formRef) {
|
|
6990
7020
|
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is required to submit the form!`);
|
|
6991
7021
|
} else if (!formRef.current) {
|
|
6992
|
-
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is empty, make sure it's passed as '
|
|
7022
|
+
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is empty, make sure it's passed as 'formRef' prop to the form!`);
|
|
6993
7023
|
}
|
|
6994
7024
|
// formRef is provided
|
|
6995
7025
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
@@ -7027,12 +7057,15 @@ const Widget = ({
|
|
|
7027
7057
|
routes,
|
|
7028
7058
|
loader,
|
|
7029
7059
|
explicitForm: _explicitForm = false,
|
|
7030
|
-
|
|
7060
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7061
|
+
// @ts-ignore
|
|
7062
|
+
permissions: _permissions = {},
|
|
7031
7063
|
preConfirmDelete,
|
|
7032
7064
|
formatListItem,
|
|
7033
7065
|
formatOptionLabel,
|
|
7034
7066
|
children
|
|
7035
7067
|
}) => {
|
|
7068
|
+
const derivedPermissions = Object.assign(DEFAULT_PERMISSIONS, _permissions);
|
|
7036
7069
|
const widgetFormRef = React.useRef(null);
|
|
7037
7070
|
const derivedT = createTranslation(t, Object.assign(Object.assign(Object.assign({}, TRANSLATION_PAIRS_COMMON), TRANSLATION_PAIRS_WIDGET), TRANSLATION_PAIRS_ITEM));
|
|
7038
7071
|
const {
|
|
@@ -7065,6 +7098,7 @@ const Widget = ({
|
|
|
7065
7098
|
itemsLoading,
|
|
7066
7099
|
onItemFormSubmit
|
|
7067
7100
|
} = useWidget({
|
|
7101
|
+
canList: derivedPermissions.list,
|
|
7068
7102
|
routes,
|
|
7069
7103
|
defaultLimit: 10,
|
|
7070
7104
|
preConfirmDelete
|
|
@@ -7101,11 +7135,11 @@ const Widget = ({
|
|
|
7101
7135
|
itemsLoading: itemsLoading,
|
|
7102
7136
|
onItemFormSubmit: onItemFormSubmit,
|
|
7103
7137
|
// Permissions
|
|
7104
|
-
canAdd:
|
|
7105
|
-
canDelete:
|
|
7106
|
-
canList:
|
|
7107
|
-
canUpdate:
|
|
7108
|
-
canPartialUpdate:
|
|
7138
|
+
canAdd: derivedPermissions.add,
|
|
7139
|
+
canDelete: derivedPermissions.delete,
|
|
7140
|
+
canList: derivedPermissions.list,
|
|
7141
|
+
canUpdate: derivedPermissions.update,
|
|
7142
|
+
canPartialUpdate: derivedPermissions.partialUpdate,
|
|
7109
7143
|
formState: formState,
|
|
7110
7144
|
closeForm: onCloseForm
|
|
7111
7145
|
}, 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,32 +6233,33 @@ 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,
|
|
6223
6258
|
loading: loading,
|
|
6224
|
-
dataKeys:
|
|
6225
|
-
label: t('widget.tableName'),
|
|
6226
|
-
dataKey: 'name',
|
|
6227
|
-
highlight: true
|
|
6228
|
-
}, {
|
|
6229
|
-
label: t('widget.tableCode'),
|
|
6230
|
-
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
|
-
}],
|
|
6259
|
+
dataKeys: dataKeys,
|
|
6242
6260
|
actions: {
|
|
6243
|
-
edit: onUpdateClick,
|
|
6244
|
-
delete: onDeleteClick
|
|
6261
|
+
edit: canUpdate ? onUpdateClick : false,
|
|
6262
|
+
delete: canDelete ? onDeleteClick : false
|
|
6245
6263
|
}
|
|
6246
6264
|
});
|
|
6247
6265
|
};
|
|
@@ -6742,6 +6760,11 @@ const WidgetForm = ({
|
|
|
6742
6760
|
type: 'checkbox',
|
|
6743
6761
|
show: showAutoPlay,
|
|
6744
6762
|
switchClass: switchClass
|
|
6763
|
+
}, {
|
|
6764
|
+
label: t('widget.color'),
|
|
6765
|
+
accessor: 'backgroundColor',
|
|
6766
|
+
type: 'color',
|
|
6767
|
+
className: 'khb_input-color'
|
|
6745
6768
|
}, {
|
|
6746
6769
|
label: t('widget.webPerRow'),
|
|
6747
6770
|
accessor: 'webPerRow',
|
|
@@ -6798,6 +6821,11 @@ const WidgetForm = ({
|
|
|
6798
6821
|
accessor: 'title',
|
|
6799
6822
|
type: 'text',
|
|
6800
6823
|
placeholder: t('item.titlePlaceholder')
|
|
6824
|
+
}, {
|
|
6825
|
+
label: `${t('item.subtitle')}`,
|
|
6826
|
+
accessor: 'subtitle',
|
|
6827
|
+
type: 'text',
|
|
6828
|
+
placeholder: t('item.subTitlePlaceholder')
|
|
6801
6829
|
}, {
|
|
6802
6830
|
label: `${t('item.altText')}`,
|
|
6803
6831
|
accessor: 'altText',
|
|
@@ -6940,7 +6968,8 @@ const WidgetPagination = () => {
|
|
|
6940
6968
|
const WidgetSearch = () => {
|
|
6941
6969
|
const {
|
|
6942
6970
|
getWidgets,
|
|
6943
|
-
t
|
|
6971
|
+
t,
|
|
6972
|
+
canList
|
|
6944
6973
|
} = useWidgetState();
|
|
6945
6974
|
const callerRef = useRef(null);
|
|
6946
6975
|
const [search, setSearch] = useState('');
|
|
@@ -6954,6 +6983,7 @@ const WidgetSearch = () => {
|
|
|
6954
6983
|
return /*#__PURE__*/React.createElement(Input, {
|
|
6955
6984
|
type: "search",
|
|
6956
6985
|
value: search,
|
|
6986
|
+
disabled: !canList,
|
|
6957
6987
|
onChange: e => onChangeSearch(e.target.value),
|
|
6958
6988
|
placeholder: t('widget.searchPlaceholder')
|
|
6959
6989
|
});
|
|
@@ -6977,7 +7007,7 @@ const WidgetFormActions = ({
|
|
|
6977
7007
|
if (!formRef) {
|
|
6978
7008
|
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is required to submit the form!`);
|
|
6979
7009
|
} else if (!formRef.current) {
|
|
6980
|
-
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is empty, make sure it's passed as '
|
|
7010
|
+
return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is empty, make sure it's passed as 'formRef' prop to the form!`);
|
|
6981
7011
|
}
|
|
6982
7012
|
// formRef is provided
|
|
6983
7013
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
@@ -7015,12 +7045,15 @@ const Widget = ({
|
|
|
7015
7045
|
routes,
|
|
7016
7046
|
loader,
|
|
7017
7047
|
explicitForm: _explicitForm = false,
|
|
7018
|
-
|
|
7048
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7049
|
+
// @ts-ignore
|
|
7050
|
+
permissions: _permissions = {},
|
|
7019
7051
|
preConfirmDelete,
|
|
7020
7052
|
formatListItem,
|
|
7021
7053
|
formatOptionLabel,
|
|
7022
7054
|
children
|
|
7023
7055
|
}) => {
|
|
7056
|
+
const derivedPermissions = Object.assign(DEFAULT_PERMISSIONS, _permissions);
|
|
7024
7057
|
const widgetFormRef = useRef(null);
|
|
7025
7058
|
const derivedT = createTranslation(t, Object.assign(Object.assign(Object.assign({}, TRANSLATION_PAIRS_COMMON), TRANSLATION_PAIRS_WIDGET), TRANSLATION_PAIRS_ITEM));
|
|
7026
7059
|
const {
|
|
@@ -7053,6 +7086,7 @@ const Widget = ({
|
|
|
7053
7086
|
itemsLoading,
|
|
7054
7087
|
onItemFormSubmit
|
|
7055
7088
|
} = useWidget({
|
|
7089
|
+
canList: derivedPermissions.list,
|
|
7056
7090
|
routes,
|
|
7057
7091
|
defaultLimit: 10,
|
|
7058
7092
|
preConfirmDelete
|
|
@@ -7089,11 +7123,11 @@ const Widget = ({
|
|
|
7089
7123
|
itemsLoading: itemsLoading,
|
|
7090
7124
|
onItemFormSubmit: onItemFormSubmit,
|
|
7091
7125
|
// Permissions
|
|
7092
|
-
canAdd:
|
|
7093
|
-
canDelete:
|
|
7094
|
-
canList:
|
|
7095
|
-
canUpdate:
|
|
7096
|
-
canPartialUpdate:
|
|
7126
|
+
canAdd: derivedPermissions.add,
|
|
7127
|
+
canDelete: derivedPermissions.delete,
|
|
7128
|
+
canList: derivedPermissions.list,
|
|
7129
|
+
canUpdate: derivedPermissions.update,
|
|
7130
|
+
canPartialUpdate: derivedPermissions.partialUpdate,
|
|
7097
7131
|
formState: formState,
|
|
7098
7132
|
closeForm: onCloseForm
|
|
7099
7133
|
}, children ? children : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AddButton, null), /*#__PURE__*/React.createElement(WidgetSearch, null), /*#__PURE__*/React.createElement("div", {
|