@cakemail-org/ui-components-v2 2.2.35 → 2.2.36

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/cjs/index.js CHANGED
@@ -8966,22 +8966,24 @@ function ColManager(_a) {
8966
8966
 
8967
8967
  function DataTable(_a) {
8968
8968
  var rows = _a.rows, columnsData = _a.columnsData, className = _a.className, onRowClick = _a.onRowClick, onRowSelect = _a.onRowSelect, onPaginationChange = _a.onPaginationChange, onSortChange = _a.onSortChange, _b = _a.showHead, showHead = _b === void 0 ? true : _b, _c = _a.showRowSelection, showRowSelection = _c === void 0 ? false : _c, _d = _a.rowIdMap, rowIdMap = _d === void 0 ? "id" : _d, _e = _a.rowsPerPageOptions, rowsPerPageOptions = _e === void 0 ? [25, 50, 100] : _e, totalCount = _a.totalCount, controlledState = _a.controlledState, initState = _a.initState, _f = _a.stickyHeader, stickyHeader = _f === void 0 ? false : _f, tableContainerSX = _a.tableContainerSX, sx = _a.sx, stickyFirstCol = _a.stickyFirstCol, stickyLastCol = _a.stickyLastCol, _g = _a.showCollapsibleContent, showCollapsibleContent = _g === void 0 ? false : _g, _h = _a.showPagination, showPagination = _h === void 0 ? true : _h, hasMore = _a.hasMore; _a.showLineSeparator; var _k = _a.useSortMemo, useSortMemo = _k === void 0 ? false : _k;
8969
- var _l = React.useState((controlledState === null || controlledState === void 0 ? void 0 : controlledState.order) || (initState === null || initState === void 0 ? void 0 : initState.order) || "asc"), order = _l[0], setOrder = _l[1];
8970
- var _m = React.useState((controlledState === null || controlledState === void 0 ? void 0 : controlledState.orderBy) || (initState === null || initState === void 0 ? void 0 : initState.orderBy) || ""), orderBy = _m[0], setOrderBy = _m[1];
8971
- var _o = React.useState((controlledState === null || controlledState === void 0 ? void 0 : controlledState.selected) || (initState === null || initState === void 0 ? void 0 : initState.selected) || []), selected = _o[0], setSelected = _o[1];
8972
- var _p = React.useState((controlledState === null || controlledState === void 0 ? void 0 : controlledState.page) || (initState === null || initState === void 0 ? void 0 : initState.page) || 0), page = _p[0], setPage = _p[1];
8973
- var _q = React.useState((controlledState === null || controlledState === void 0 ? void 0 : controlledState.rowsPerPage) || (initState === null || initState === void 0 ? void 0 : initState.rowsPerPage) || 50), rowsPerPage = _q[0], setRowsPerPage = _q[1];
8974
- //TODO controlled state
8975
- //TODO showLineSeparator false
8976
- React.useEffect(function () {
8977
- if (controlledState) {
8978
- controlledState.order && setOrder(controlledState.order);
8979
- controlledState.orderBy && setOrderBy(controlledState.orderBy);
8980
- controlledState.selected && setSelected(controlledState.selected);
8981
- controlledState.page && setPage(controlledState.page);
8982
- controlledState.rowsPerPage && setRowsPerPage(controlledState.rowsPerPage);
8983
- }
8984
- }, [controlledState]);
8969
+ var _l = React.useState((initState === null || initState === void 0 ? void 0 : initState.order) || "asc"), cOrder = _l[0], setOrder = _l[1];
8970
+ var _m = React.useState((initState === null || initState === void 0 ? void 0 : initState.orderBy) || ""), cOrderBy = _m[0], setOrderBy = _m[1];
8971
+ var _o = React.useState((initState === null || initState === void 0 ? void 0 : initState.selected) || []), cSelected = _o[0], setSelected = _o[1];
8972
+ var _p = React.useState((initState === null || initState === void 0 ? void 0 : initState.page) || 0), cPage = _p[0], setPage = _p[1];
8973
+ var _q = React.useState((initState === null || initState === void 0 ? void 0 : initState.rowsPerPage) || 50), cRowsPerPage = _q[0], setRowsPerPage = _q[1];
8974
+ var isControlled = areAllPropertiesEmpty(controlledState);
8975
+ var order = cOrder;
8976
+ var orderBy = cOrderBy;
8977
+ var selected = cSelected;
8978
+ var page = cPage;
8979
+ var rowsPerPage = cRowsPerPage;
8980
+ if (isControlled) {
8981
+ order = (controlledState === null || controlledState === void 0 ? void 0 : controlledState.order) || "asc";
8982
+ orderBy = (controlledState === null || controlledState === void 0 ? void 0 : controlledState.orderBy) || "";
8983
+ selected = (controlledState === null || controlledState === void 0 ? void 0 : controlledState.selected) || [];
8984
+ page = (controlledState === null || controlledState === void 0 ? void 0 : controlledState.page) || 0;
8985
+ rowsPerPage = (controlledState === null || controlledState === void 0 ? void 0 : controlledState.rowsPerPage) || 50;
8986
+ }
8985
8987
  function handleRequestSort(event, property) {
8986
8988
  var isAsc = orderBy === property && order === 'asc';
8987
8989
  var cOrder = isAsc ? 'desc' : 'asc';
package/dist/esm/index.js CHANGED
@@ -8946,22 +8946,24 @@ function ColManager(_a) {
8946
8946
 
8947
8947
  function DataTable(_a) {
8948
8948
  var rows = _a.rows, columnsData = _a.columnsData, className = _a.className, onRowClick = _a.onRowClick, onRowSelect = _a.onRowSelect, onPaginationChange = _a.onPaginationChange, onSortChange = _a.onSortChange, _b = _a.showHead, showHead = _b === void 0 ? true : _b, _c = _a.showRowSelection, showRowSelection = _c === void 0 ? false : _c, _d = _a.rowIdMap, rowIdMap = _d === void 0 ? "id" : _d, _e = _a.rowsPerPageOptions, rowsPerPageOptions = _e === void 0 ? [25, 50, 100] : _e, totalCount = _a.totalCount, controlledState = _a.controlledState, initState = _a.initState, _f = _a.stickyHeader, stickyHeader = _f === void 0 ? false : _f, tableContainerSX = _a.tableContainerSX, sx = _a.sx, stickyFirstCol = _a.stickyFirstCol, stickyLastCol = _a.stickyLastCol, _g = _a.showCollapsibleContent, showCollapsibleContent = _g === void 0 ? false : _g, _h = _a.showPagination, showPagination = _h === void 0 ? true : _h, hasMore = _a.hasMore; _a.showLineSeparator; var _k = _a.useSortMemo, useSortMemo = _k === void 0 ? false : _k;
8949
- var _l = useState((controlledState === null || controlledState === void 0 ? void 0 : controlledState.order) || (initState === null || initState === void 0 ? void 0 : initState.order) || "asc"), order = _l[0], setOrder = _l[1];
8950
- var _m = useState((controlledState === null || controlledState === void 0 ? void 0 : controlledState.orderBy) || (initState === null || initState === void 0 ? void 0 : initState.orderBy) || ""), orderBy = _m[0], setOrderBy = _m[1];
8951
- var _o = useState((controlledState === null || controlledState === void 0 ? void 0 : controlledState.selected) || (initState === null || initState === void 0 ? void 0 : initState.selected) || []), selected = _o[0], setSelected = _o[1];
8952
- var _p = useState((controlledState === null || controlledState === void 0 ? void 0 : controlledState.page) || (initState === null || initState === void 0 ? void 0 : initState.page) || 0), page = _p[0], setPage = _p[1];
8953
- var _q = useState((controlledState === null || controlledState === void 0 ? void 0 : controlledState.rowsPerPage) || (initState === null || initState === void 0 ? void 0 : initState.rowsPerPage) || 50), rowsPerPage = _q[0], setRowsPerPage = _q[1];
8954
- //TODO controlled state
8955
- //TODO showLineSeparator false
8956
- useEffect(function () {
8957
- if (controlledState) {
8958
- controlledState.order && setOrder(controlledState.order);
8959
- controlledState.orderBy && setOrderBy(controlledState.orderBy);
8960
- controlledState.selected && setSelected(controlledState.selected);
8961
- controlledState.page && setPage(controlledState.page);
8962
- controlledState.rowsPerPage && setRowsPerPage(controlledState.rowsPerPage);
8963
- }
8964
- }, [controlledState]);
8949
+ var _l = useState((initState === null || initState === void 0 ? void 0 : initState.order) || "asc"), cOrder = _l[0], setOrder = _l[1];
8950
+ var _m = useState((initState === null || initState === void 0 ? void 0 : initState.orderBy) || ""), cOrderBy = _m[0], setOrderBy = _m[1];
8951
+ var _o = useState((initState === null || initState === void 0 ? void 0 : initState.selected) || []), cSelected = _o[0], setSelected = _o[1];
8952
+ var _p = useState((initState === null || initState === void 0 ? void 0 : initState.page) || 0), cPage = _p[0], setPage = _p[1];
8953
+ var _q = useState((initState === null || initState === void 0 ? void 0 : initState.rowsPerPage) || 50), cRowsPerPage = _q[0], setRowsPerPage = _q[1];
8954
+ var isControlled = areAllPropertiesEmpty(controlledState);
8955
+ var order = cOrder;
8956
+ var orderBy = cOrderBy;
8957
+ var selected = cSelected;
8958
+ var page = cPage;
8959
+ var rowsPerPage = cRowsPerPage;
8960
+ if (isControlled) {
8961
+ order = (controlledState === null || controlledState === void 0 ? void 0 : controlledState.order) || "asc";
8962
+ orderBy = (controlledState === null || controlledState === void 0 ? void 0 : controlledState.orderBy) || "";
8963
+ selected = (controlledState === null || controlledState === void 0 ? void 0 : controlledState.selected) || [];
8964
+ page = (controlledState === null || controlledState === void 0 ? void 0 : controlledState.page) || 0;
8965
+ rowsPerPage = (controlledState === null || controlledState === void 0 ? void 0 : controlledState.rowsPerPage) || 50;
8966
+ }
8965
8967
  function handleRequestSort(event, property) {
8966
8968
  var isAsc = orderBy === property && order === 'asc';
8967
8969
  var cOrder = isAsc ? 'desc' : 'asc';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cakemail-org/ui-components-v2",
3
- "version": "2.2.35",
3
+ "version": "2.2.36",
4
4
  "description": "ui library kit made with material UI",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",