@cakemail-org/ui-components-v2 2.1.5 → 2.1.6

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
@@ -8876,7 +8876,7 @@ function DataTable(_a) {
8876
8876
  showPagination && (hasMore !== undefined ? (React.createElement(DataTablePaginationNoCount, { page: page, setPage: setPage, onPaginationChange: onPaginationChange, rowsPerPage: rowsPerPage, hasMore: hasMore })) : (React.createElement(TablePagination, { rowsPerPageOptions: rowsPerPageOptions, component: "div", count: totalCount !== undefined ? totalCount : rows.length, rowsPerPage: rowsPerPage, page: page, onPageChange: handleChangePage, onRowsPerPageChange: handleChangeRowsPerPage }))));
8877
8877
  }
8878
8878
 
8879
- var css_248z$f = ".dateTimeSelector.dateTimeCalendar {\n background: var(--white, #FFFFFF);\n}";
8879
+ var css_248z$f = ".dateTimeSelector.dateTimeCalendar {\n background: var(--white, #FFFFFF);\n}\n.dateTimeSelector .MuiMultiSectionDigitalClock-root,\n.dateTimeSelector .MuiMultiSectionDigitalClockSection-root {\n flex: 1;\n}\n.dateTimeSelector .MuiMultiSectionDigitalClock-root .MuiMultiSectionDigitalClockSection-item.Mui-selected,\n.dateTimeSelector .MuiMultiSectionDigitalClockSection-root .MuiMultiSectionDigitalClockSection-item.Mui-selected {\n background-color: var(--primary-brand-color, var(--grape, #69006E)) !important;\n}";
8880
8880
  styleInject(css_248z$f);
8881
8881
 
8882
8882
  function DatePicker(_a) {
@@ -8915,8 +8915,12 @@ function DateTimeCalendar(_a) {
8915
8915
  var classes = classNames("dateTimeSelector", "dateTimeCalendar", className);
8916
8916
  return React.createElement(LocalizationProvider.LocalizationProvider, { dateAdapter: AdapterMoment.AdapterMoment },
8917
8917
  React.createElement(xDatePickers.StaticDateTimePicker, __assign({}, props, { view: currentView,
8918
- //Preview default auto switch
8919
- onViewChange: function (newView) { }, className: classes, viewRenderers: {
8918
+ //Preview default auto switch fix
8919
+ onViewChange: function (newView) {
8920
+ if (currentView !== "hours" && (newView === "year" || currentView === "year")) {
8921
+ setCurrentView(newView);
8922
+ }
8923
+ }, className: classes, viewRenderers: {
8920
8924
  hours: function (props) {
8921
8925
  return React.createElement(xDatePickers.MultiSectionDigitalClock, { ampm: props.ampm, minTime: props.minTime, maxTime: props.maxTime, onChange: props.onChange, value: props.value, defaultValue: props.defaultValue, disableFuture: props.disableFuture, disablePast: props.disablePast, timezone: props.timezone });
8922
8926
  },
@@ -8926,6 +8930,7 @@ function DateTimeCalendar(_a) {
8926
8930
  tabs: {
8927
8931
  //@ts-ignore
8928
8932
  onViewChange: function (view) {
8933
+ console.log("view", view);
8929
8934
  setCurrentView(view);
8930
8935
  }
8931
8936
  }
package/dist/esm/index.js CHANGED
@@ -8856,7 +8856,7 @@ function DataTable(_a) {
8856
8856
  showPagination && (hasMore !== undefined ? (React__default.createElement(DataTablePaginationNoCount, { page: page, setPage: setPage, onPaginationChange: onPaginationChange, rowsPerPage: rowsPerPage, hasMore: hasMore })) : (React__default.createElement(TablePagination, { rowsPerPageOptions: rowsPerPageOptions, component: "div", count: totalCount !== undefined ? totalCount : rows.length, rowsPerPage: rowsPerPage, page: page, onPageChange: handleChangePage, onRowsPerPageChange: handleChangeRowsPerPage }))));
8857
8857
  }
8858
8858
 
8859
- var css_248z$f = ".dateTimeSelector.dateTimeCalendar {\n background: var(--white, #FFFFFF);\n}";
8859
+ var css_248z$f = ".dateTimeSelector.dateTimeCalendar {\n background: var(--white, #FFFFFF);\n}\n.dateTimeSelector .MuiMultiSectionDigitalClock-root,\n.dateTimeSelector .MuiMultiSectionDigitalClockSection-root {\n flex: 1;\n}\n.dateTimeSelector .MuiMultiSectionDigitalClock-root .MuiMultiSectionDigitalClockSection-item.Mui-selected,\n.dateTimeSelector .MuiMultiSectionDigitalClockSection-root .MuiMultiSectionDigitalClockSection-item.Mui-selected {\n background-color: var(--primary-brand-color, var(--grape, #69006E)) !important;\n}";
8860
8860
  styleInject(css_248z$f);
8861
8861
 
8862
8862
  function DatePicker(_a) {
@@ -8895,8 +8895,12 @@ function DateTimeCalendar(_a) {
8895
8895
  var classes = classNames("dateTimeSelector", "dateTimeCalendar", className);
8896
8896
  return React__default.createElement(LocalizationProvider, { dateAdapter: AdapterMoment },
8897
8897
  React__default.createElement(StaticDateTimePicker, __assign({}, props, { view: currentView,
8898
- //Preview default auto switch
8899
- onViewChange: function (newView) { }, className: classes, viewRenderers: {
8898
+ //Preview default auto switch fix
8899
+ onViewChange: function (newView) {
8900
+ if (currentView !== "hours" && (newView === "year" || currentView === "year")) {
8901
+ setCurrentView(newView);
8902
+ }
8903
+ }, className: classes, viewRenderers: {
8900
8904
  hours: function (props) {
8901
8905
  return React__default.createElement(MultiSectionDigitalClock, { ampm: props.ampm, minTime: props.minTime, maxTime: props.maxTime, onChange: props.onChange, value: props.value, defaultValue: props.defaultValue, disableFuture: props.disableFuture, disablePast: props.disablePast, timezone: props.timezone });
8902
8906
  },
@@ -8906,6 +8910,7 @@ function DateTimeCalendar(_a) {
8906
8910
  tabs: {
8907
8911
  //@ts-ignore
8908
8912
  onViewChange: function (view) {
8913
+ console.log("view", view);
8909
8914
  setCurrentView(view);
8910
8915
  }
8911
8916
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cakemail-org/ui-components-v2",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "ui library kit made with material UI",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",