@mcurros2/microm 1.1.2-0 → 1.1.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/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35970,7 +35970,7 @@ var $40c00e2ecacb5ae0$var$__awaiter = undefined && undefined.__awaiter || functi
|
|
|
35970
35970
|
});
|
|
35971
35971
|
};
|
|
35972
35972
|
function $40c00e2ecacb5ae0$export$2d2c672e82add59e(props, stateProps) {
|
|
35973
|
-
const { entity: entity, parentKeys: parentKeys, viewName: viewName, limit: limit, onSelectionChanged: onSelectionChanged, modalFormSize: modalFormSize, labels: labels, saveFormBeforeAdd: saveFormBeforeAdd, parentFormAPI: parentFormAPI, allwaysRefreshOnEntityClose: allwaysRefreshOnEntityClose, notExportableColumns: notExportableColumns, itemsPerPage: itemsPerPage, onActionExecuted: onActionExecuted, convertResultToLocaleString: convertResultToLocaleString, onDataRefresh: onDataRefresh } = props;
|
|
35973
|
+
const { entity: entity, parentKeys: parentKeys, viewName: viewName, limit: limit, onSelectionChanged: onSelectionChanged, modalFormSize: modalFormSize, onModalSaved: onModalSaved, labels: labels, saveFormBeforeAdd: saveFormBeforeAdd, parentFormAPI: parentFormAPI, allwaysRefreshOnEntityClose: allwaysRefreshOnEntityClose, notExportableColumns: notExportableColumns, itemsPerPage: itemsPerPage, onActionExecuted: onActionExecuted, convertResultToLocaleString: convertResultToLocaleString, onDataRefresh: onDataRefresh } = props;
|
|
35974
35974
|
const localeFormat = (0, $a2vzY.useLocaleFormat)({});
|
|
35975
35975
|
const { setRefresh: setRefresh, setSearchText: setSearchText, executeViewState: executeViewState } = stateProps;
|
|
35976
35976
|
const selectedRecords = (0, $b4te3$react.useRef)([]);
|
|
@@ -35982,19 +35982,31 @@ function $40c00e2ecacb5ae0$export$2d2c672e82add59e(props, stateProps) {
|
|
|
35982
35982
|
const [displayedItemsCount, setDisplayedItemsCount] = (0, $b4te3$react.useState)(itemsPerPage);
|
|
35983
35983
|
const [viewResult, setViewResult] = (0, $b4te3$react.useState)(null);
|
|
35984
35984
|
// MMC: we can't use callbacks here because we need to use the latest values of the state variables
|
|
35985
|
-
|
|
35985
|
+
const internalRefresh = (0, $b4te3$react.useCallback)(()=>{
|
|
35986
35986
|
setRefresh((prev)=>!prev);
|
|
35987
|
-
}
|
|
35988
|
-
|
|
35987
|
+
}, [
|
|
35988
|
+
setRefresh
|
|
35989
|
+
]);
|
|
35990
|
+
const handleRefresh = (0, $b4te3$react.useCallback)((search_text)=>{
|
|
35989
35991
|
setSearchText(search_text);
|
|
35990
35992
|
setRefresh((prev)=>!prev);
|
|
35991
|
-
}
|
|
35992
|
-
|
|
35993
|
-
|
|
35994
|
-
|
|
35995
|
-
|
|
35993
|
+
}, [
|
|
35994
|
+
setRefresh,
|
|
35995
|
+
setSearchText
|
|
35996
|
+
]);
|
|
35997
|
+
const handleModalSaved = (0, $b4te3$react.useCallback)((new_status)=>$40c00e2ecacb5ae0$var$__awaiter(this, void 0, void 0, function*() {
|
|
35998
|
+
if (!new_status.error && !new_status.loading && new_status.data) internalRefresh();
|
|
35999
|
+
if (onModalSaved) yield onModalSaved(new_status);
|
|
36000
|
+
}), [
|
|
36001
|
+
internalRefresh,
|
|
36002
|
+
onModalSaved
|
|
36003
|
+
]);
|
|
36004
|
+
const handleAllwaysRefreshOnClose = (0, $b4te3$react.useCallback)(()=>{
|
|
35996
36005
|
if (allwaysRefreshOnEntityClose) internalRefresh();
|
|
35997
|
-
}
|
|
36006
|
+
}, [
|
|
36007
|
+
allwaysRefreshOnEntityClose,
|
|
36008
|
+
internalRefresh
|
|
36009
|
+
]);
|
|
35998
36010
|
const UIAPI = (0, $1uAlg.useEntityUI)({
|
|
35999
36011
|
entity: entity,
|
|
36000
36012
|
parentKeys: parentKeys,
|
|
@@ -36265,8 +36277,8 @@ const $55dd21617ac1c7dc$export$8d0177ff9f5686ad = {
|
|
|
36265
36277
|
};
|
|
36266
36278
|
const $55dd21617ac1c7dc$export$5e15d737b33a1c27 = /*#__PURE__*/ (0, $b4te3$react.forwardRef)(function DataView(props, ref) {
|
|
36267
36279
|
var _a;
|
|
36268
|
-
|
|
36269
|
-
const { entity: entity, autoFocus: autoFocus, toolbarIconVariant: toolbarIconVariant, actionsButtonVariant: actionsButtonVariant, enableAdd: enableAdd, enableEdit: enableEdit, enableDelete: enableDelete, enableView: enableView, enableExport: enableExport, labels: labels, Card: Card, CardContainer: CardContainer, limit: limit, search: search, viewName: viewName, filtersFormSize: filtersFormSize, toolbarSize: toolbarSize, showAppliedFilters: showAppliedFilters, showRefreshButton: showRefreshButton, hideCheckboxToggle: hideCheckboxToggle, showFiltersButton: showFiltersButton, searchPlaceholder: searchPlaceholder, showActions: showActions, parentKeys: parentKeys, visibleFilters: visibleFilters, setInitialFiltersFromColumns: setInitialFiltersFromColumns, cardHrefRootURL: cardHrefRootURL, cardHrefTarget: cardHrefTarget, showSearchInput: showSearchInput, showSelectRowsButton: showSelectRowsButton, showToolbar: showToolbar } =
|
|
36280
|
+
props = (0, $b4te3$mantinecore.useComponentDefaultProps)("DataView", $55dd21617ac1c7dc$export$8d0177ff9f5686ad, props);
|
|
36281
|
+
const { entity: entity, autoFocus: autoFocus, toolbarIconVariant: toolbarIconVariant, actionsButtonVariant: actionsButtonVariant, enableAdd: enableAdd, enableEdit: enableEdit, enableDelete: enableDelete, enableView: enableView, enableExport: enableExport, labels: labels, Card: Card, CardContainer: CardContainer, limit: limit, search: search, viewName: viewName, filtersFormSize: filtersFormSize, toolbarSize: toolbarSize, showAppliedFilters: showAppliedFilters, showRefreshButton: showRefreshButton, hideCheckboxToggle: hideCheckboxToggle, showFiltersButton: showFiltersButton, searchPlaceholder: searchPlaceholder, showActions: showActions, parentKeys: parentKeys, visibleFilters: visibleFilters, setInitialFiltersFromColumns: setInitialFiltersFromColumns, cardHrefRootURL: cardHrefRootURL, cardHrefTarget: cardHrefTarget, showSearchInput: showSearchInput, showSelectRowsButton: showSelectRowsButton, showToolbar: showToolbar } = props;
|
|
36270
36282
|
const [searchData, setSearchData] = (0, $b4te3$react.useState)(search === null || search === void 0 ? void 0 : search.map((s)=>{
|
|
36271
36283
|
return {
|
|
36272
36284
|
value: s,
|
|
@@ -36275,7 +36287,7 @@ const $55dd21617ac1c7dc$export$5e15d737b33a1c27 = /*#__PURE__*/ (0, $b4te3$react
|
|
|
36275
36287
|
}));
|
|
36276
36288
|
const viewState = (0, $7B1hX.useViewState)(search, limit);
|
|
36277
36289
|
const executeViewState = (0, $lB8CV.useExecuteView)(entity, parentKeys, viewName, viewState.searchText, viewState.limitRows, viewState.refresh, viewState.filterValues);
|
|
36278
|
-
const dataViewAPI = (0, $5yF9X.useDataView)(
|
|
36290
|
+
const dataViewAPI = (0, $5yF9X.useDataView)(props, {
|
|
36279
36291
|
executeViewState: executeViewState,
|
|
36280
36292
|
setRefresh: viewState.setRefresh,
|
|
36281
36293
|
setSearchText: viewState.setSearchText
|